public function __construct()
 {
     parent::__construct();
     $this->model = M('Model')->getByName('e_iteam');
     $this->assign('model', $this->model);
     $this->assign('is_iteam', 1);
 }
 public function __construct()
 {
     parent::__construct();
     $this->token = get_token();
     $this->wecha_id = get_openid();
     // 读取配置
     $pay_config_db = M('payment_set');
     $paymentSet = $pay_config_db->where(array('token' => $this->token))->find();
     if ($paymentSet['wx_cert_pem'] && $paymentSet['wx_key_pem']) {
         $ids[] = $paymentSet['wx_cert_pem'];
         $ids[] = $paymentSet['wx_key_pem'];
         $map['id'] = array('in', $ids);
         $fileData = M('file')->where($map)->select();
         $downloadConfig = C(DOWNLOAD_UPLOAD);
         foreach ($fileData as $f) {
             if ($paymentSet['wx_cert_pem'] == $f['id']) {
                 $certpath = SITE_PATH . str_replace('/', '\\', substr($downloadConfig['rootPath'], 1) . $f['savepath'] . $f['savename']);
             } else {
                 $keypath = SITE_PATH . str_replace('/', '\\', substr($downloadConfig['rootPath'], 1) . $f['savepath'] . $f['savename']);
             }
         }
         $paymentSet['cert_path'] = $certpath;
         $paymentSet['key_path'] = $keypath;
     }
     $this->payConfig = $paymentSet;
     session('paymentinfo', $this->payConfig);
 }
 public function __construct()
 {
     parent::__construct();
     $this->SQL_QUERY_CANDIDATES = "SELECT *, COALESCE(T2.count2, 0) AS count FROM " . C('DB_PREFIX') . "wevote_candidates AS T1\nLEFT JOIN (SELECT COUNT(id) AS count2, candidate_id FROM " . C('DB_PREFIX') . "wevote_info GROUP BY candidate_id) AS T2\nON T1.id = T2.candidate_id\nWHERE (action_id = %d) AND (status = 1) %s\nORDER BY count DESC LIMIT %d, %d";
     $this->SQL_QUERY_CANDIDATES_LATEST = "SELECT *, COALESCE(T2.count2, 0) AS count FROM " . C('DB_PREFIX') . "wevote_candidates AS T1\nLEFT JOIN (SELECT COUNT(id) AS count2, candidate_id FROM " . C('DB_PREFIX') . "wevote_info GROUP BY candidate_id) AS T2\nON T1.id = T2.candidate_id\nWHERE (action_id = %d) AND (status = 1) %s\nORDER BY T1.datetime DESC LIMIT %d, %d";
     $this->SQL_QUERY_CANDIDATES_ALL = "SELECT *, COALESCE(T2.count2, 0) AS count FROM " . C('DB_PREFIX') . "wevote_candidates AS T1\nLEFT JOIN (SELECT COUNT(id) AS count2, candidate_id FROM " . C('DB_PREFIX') . "wevote_info GROUP BY candidate_id) AS T2\nON T1.id = T2.candidate_id\nWHERE (action_id = %d) AND (status = 1) %s\nORDER BY T1.id DESC LIMIT %d, %d";
     $this->SQL_QUERY_VoteInfo = "SELECT c.title,COUNT(0) num FROM " . C('DB_PREFIX') . "wevote_voters AS v\nLEFT JOIN  " . C('DB_PREFIX') . "wevote_info i ON v.id = i.voter_id\nLEFT JOIN " . C('DB_PREFIX') . "wevote_candidates c ON i.candidate_id = c.id\nWHERE (v.openid = '%s') AND (v.action_id = %d) GROUP BY c.title";
 }
Esempio n. 4
0
 public function __construct()
 {
     parent::__construct();
     $this->model = M('Model')->getByName($_REQUEST['_controller']);
     $this->model || $this->error('模型不存在!');
     $this->assign('model', $this->model);
     $this->option = M('Model')->getByName('vote_option');
     $this->assign('option', $this->option);
 }
 public function __construct()
 {
     parent::__construct();
     $this->token = get_token();
     $this->wecha_id = get_openid();
     // 读取配置
     $alipay_config_db = M('payment_set');
     $this->alipayConfig = $alipay_config_db->where(array('token' => $this->token))->find();
 }
 public function __construct()
 {
     parent::__construct();
     $this->model = M('Model')->getByName('coupons');
     $this->assign('model', $this->model);
     if (empty(session('used_shop')) && empty(cookie("used_shop")) && !is_login()) {
         $this->error("商家未登录");
         die;
     }
 }
 function __construct()
 {
     parent::__construct();
     $Join2011Addon = new Join2011Addon();
     $_config = $Join2011Addon->getConfig();
     if ($_config['openReg'] == 0) {
         $this->error("报名通道目前关闭", U('Home/Index/index'));
     }
     if (strtotime($_config['endTime']) - time() < 0) {
         $this->error("报名已经截至", U('Home/Index/index'));
     }
 }
Esempio n. 8
0
 public function __construct()
 {
     if (_ACTION == 'show') {
         $GLOBALS['is_wap'] = true;
     }
     parent::__construct();
     $this->model = getModelByName($_REQUEST['_controller']);
     $this->model || $this->error('模型不存在!');
     $this->assign('model', $this->model);
     $this->option = getModelByName('vote_option');
     $this->assign('option', $this->option);
     $this->vlog = getModelByName('vote_log');
     $this->assign('vlog', $this->vlog);
 }
Esempio n. 9
0
 public function __construct()
 {
     parent::__construct();
     $this->model = getModelByName($_REQUEST['_controller']);
     $this->model || $this->error('模型不存在!');
     $this->assign('model', $this->model);
     $this->option = getModelByName('xydzp_option');
     $this->assign('option', $this->option);
     $this->jplist = getModelByName('xydzp_jplist');
     $this->assign('jplist', $this->jplist);
     $arr = array('lists', 'add', 'edit');
     $action = strtolower(_ACTION);
     $res['title'] = '幸运大转盘';
     $res['url'] = addons_url('Xydzp://Xydzp/lists');
     $res['class'] = in_array($action, $arr) ? 'current' : '';
     $nav[] = $res;
     $arr = array('jpoplists', 'jpopadd', 'jpopedit');
     $res['title'] = '奖品库管理';
     $res['url'] = addons_url('Xydzp://Xydzp/jpoplists');
     $res['class'] = in_array($action, $arr) ? 'current' : '';
     $nav[] = $res;
     $res['title'] = '功能设置';
     $res['url'] = addons_url('Xydzp://Xydzp/config');
     $res['class'] = $action == 'config' ? 'current' : '';
     $nav[] = $res;
     $arr = array('zjloglists', 'zjlogadd', 'zjlogedit');
     if (in_array($action, $arr)) {
         $res['title'] = '中奖记录';
         $res['url'] = addons_url('Xydzp://Xydzp/zjloglists');
         $res['class'] = 'current';
         $nav[] = $res;
     }
     $arr = array('jplists', 'jpadd', 'jpedit');
     if (in_array($action, $arr)) {
         $res['title'] = '奖品设置';
         $res['url'] = addons_url('Xydzp://Xydzp/jplists');
         $res['class'] = 'current';
         $nav[] = $res;
     }
     $this->assign('nav', $nav);
 }
 public function __construct()
 {
     parent::__construct();
     $this->model = $this->getModel('shop_vote');
     $this->model || $this->error('模型不存在!');
 }
 function __construct()
 {
     parent::__construct();
     $this->model = M('Model')->getByName('e_iteam_type');
     $this->assign('model', $this->model);
 }
 function __construct()
 {
     parent::__construct();
     $this->model = M('Model')->getByName('e_competition');
     $this->assign('model', $this->model);
 }
Esempio n. 13
0
 public function __construct()
 {
     parent::__construct();
     $this->model = M('Model')->getByName('credit');
     $this->assign('model', $this->model);
 }