Server : nginx/1.22.1
System : Linux iZwz9daxib3w3i063fw434Z 3.10.0-1127.19.1.el7.x86_64 #1 SMP Tue Aug 25 17:23:54 UTC 2020 x86_64
User : www ( 1000)
PHP Version : 7.2.33
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Directory :  /www/wwwroot/www.jkmold.com/phpcms/modules/vote/classes/
Upload File :
Current Directory [ Writeable ] Root Directory [ Writeable ]


Current File : /www/wwwroot/www.jkmold.com/phpcms/modules/vote/classes/vote_tag.class.php
<?php

defined('IN_PHPCMS') or exit('No permission resources.');

class vote_tag {

 	public function __construct() {

		$this->subject_db = pc_base::load_model('vote_subject_model');

		$this->option_db = pc_base::load_model('vote_option_model');

	}

	

	/**

	 * 显示

	 * @param  $data 

	 */

	public function show($data) {

		$subjectid = $data['subjectid'];//投票ID

		if($subjectid){

			if(is_int($subjectid)) return false;

			$sql = array('subjectid'=>$subjectid);

		}else {

			$sql = '';

		}

		return $this->subject_db->select($sql, '*', $data['limit']);

	}

	

	/**

	 * 其它投票

	 * @param  $data 

	 */

	public function other_vote($data) {

		$siteid = intval($_GET['siteid']);

		$sql = array('siteid'=>$siteid); 

		return $this->subject_db->select($sql, '*', $data['limit'], $data['order']);

	} 

	

	/**

	 * 投票热度排行 

	 * @param  $data 传入的数组参数

	 */

	public function hits($data) {

		$siteid = intval($data['siteid']);

		$enabled = $data['enabled']?$data['enabled'] : 1;//状态:是否启用

		if (empty($siteid)){

			$siteid = get_siteid();

		}

		switch ($enabled) {

			case all://不限

				$sql = array('siteid'=>$siteid); 

				break; 

			default://默认按选择项

				$sql = array('siteid'=>$siteid,'enabled'=>$enabled); 

		}

		return $this->subject_db->select($sql, '*', $data['limit'], 'votenumber '.$data['order']);

	} 

	

	/**

	 * 

	 * 投票列表

	 * @param $data 数组参数

	 */

	public function lists($data) {

		$siteid = intval($data['siteid']);

		$enabled = $data['enabled']?$data['enabled'] : 1;//状态:是否启用

		$order = $data['order']?$data['order'] : 'subjectid desc';//状态:是否启用

		if (empty($siteid)){

			$siteid = get_siteid();

		}

		switch ($enabled) {

			case all://不限

				$sql = array('siteid'=>$siteid); 

				break; 

			default://默认按选择项

				$sql = array('siteid'=>$siteid,'enabled'=>$enabled); 

		}

 		return $this->subject_db->select($sql, '*', $data['limit'], $order);

	}	



	/**

	 * 投票概况

	 */

	public function get_vote($data) {

		$subjectid = intval($data['subjectid']);

		if (empty($subjectid)) return false;

  		return  $this->subject_db->get_one(array('subjectid'=>$subjectid));

	}

	

	/**

	 * 计数

	 */

	public function count($data) {

		if(isset($data['where'])) {

			$sql = $data['where'];

		} else {

				$siteid = intval($data['siteid']);

				$enabled = $data['enabled']?$data['enabled'] : 1;//状态:是否启用

				if (empty($siteid)){

					$siteid = get_siteid();

				}

				switch ($enabled) {

					case all://不限

						$sql = array('siteid'=>$siteid); 

						break; 

					default://默认按选择项

						$sql = array('siteid'=>$siteid,'enabled'=>$enabled); 

				}

		 		return $this->subject_db->count($sql); 

		}		 		

	}

	 

	/**

	 * pc 标签调用

	 */

	public function pc_tag() {

		$sites = pc_base::load_app_class('sites','admin');

		$sitelist = $sites->pc_tag_list();

		return array(

			'action'=>array('lists'=>L('list','', 'comment'),'get_vote'=>L('vote_overview','','vote')),

			'lists'=>array(

						'siteid'=>array('name'=>L('site_id', '', 'comment'),'htmltype'=>'input_select', 'data'=>$sitelist,'validator'=>array('min'=>1)),

 						'enabled'=>array('name'=>L('vote_status','','vote'), 'htmltype'=>'select', 'data'=>array('all'=>L('vote_Lockets','','vote'),'1'=>L('vote_use','','vote'), '0'=>L('vote_lock','','vote'))),

						'order'=>array('name'=>L('sort', '', 'comment'), 'htmltype'=>'select','data'=>array('subjectid desc'=>L('subjectid_desc', '', 'vote'), 'subjectid asc'=>L('subjectid_asc', '', 'vote'))),

					),

		    'get_vote'=>array(

						'subjectid'=>array('name'=>L('vote_voteid','','vote'),'htmltype'=>'input', 'validator'=>array('min'=>1)), 

					),

		);

	}

}