public function index() { //查询数据分配到模板 $res = get_cps_trader('shares_global'); $this->assign('maxprincipal', $res[0]); //最大本金 $this->assign('minprincipal', $res[1]); //最小本金 $this->assign('dbrate', $res[2]); //倍率 $noticerate = $res[3] / 100; $this->assign('noticerate', $noticerate); //警戒线倍率 $closerate = $res[4] / 100; $this->assign('closerate', $closerate); //平仓线倍率 $this->assign('tradingday', $res[5]); //交易天数 //获取当前时间 $time = time(); //获取当前的小时数 $hour = date('H', $time); //获取星期中的第几天 $whatday = date('w', $time); //当今天是周末的时候或者今天下午两点半 或者今天是节假日 只能选下个交易日 $res = get_holiday_data('shares_holiday'); if ($res == '1' || $whatday == 6 || $whatday == 0 || $hour >= 14) { //如果返回1证明处在节假日之间 $this->assign('holiday', 1); } else { $this->assign('holiday', 0); } $this->display(); }
public function payment() { $money = M('member_money')->where("uid = {$this->uid}")->find(); //获取当前时间 $time = time(); //获取当前的小时数 $hour = date('H', $time); //获取星期中的第几天 $whatday = date('w', $time); //当今天是周末的时候或者今天下午两点半 或者今天是节假日 只能选下个交易日 $res = get_holiday_data('shares_holiday'); if ($res == '1' || $whatday == 6 || $whatday == 0 || $hour >= 14) { //如果返回1证明处在节假日之间 $this->assign('holiday', 1); } else { $this->assign('holiday', 0); } $this->assign("money", $money); $this->display(); }
public function month() { //echo "erieur";die; $lever = D("SharesLever")->getMonthLever(); $term_config = D("SharesType")->getMonthtermConfig(); $money_config = D("SharesType")->getMonthmoneyConfig(); if (get_holiday_data('shares_holiday') == '1' || date('w', time()) == 6 || date('w', time()) == 0 || date('H', time()) >= 14) { $this->assign('holiday', 1); } else { $this->assign('holiday', 0); } //配资排行榜 $shares_list = M('shares_apply a')->field("a.shares_money,a.add_time,a.duration,m.user_name")->join("lzh_members m ON m.id = a.uid")->where("a.type_id = 2 AND a.status in(2,3,6)")->order("a.id DESC")->select(); $this->assign("shares_list", $shares_list); $this->assign("count", count($shares_list)); $this->assign("uid", $this->uid); $this->assign("term", $term_config); $this->assign("min_money", $money_config[0]); $this->assign("max_money", $money_config[1]); $this->assign("lever", $lever); //var_dump($lever['0']['open_ratio']);die; $this->display(); }
public function Manipulator() { $jsoncode = file_get_contents("php://input"); $arr = array(); $arr = json_decode($jsoncode, true); if (!is_array($arr) || empty($arr) || empty($arr['uid'])) { ajaxmsg("查询错误!", 0); } $res = get_cps_trader('shares_global'); $list['maxprincipal'] = $res[0]; $list['minprincipal'] = $res[1]; $list['dbrate'] = $res[2]; $list['noticerate'] = $res[3] / 100; $list['closerate'] = $res[4] / 100; $list['tradingday'] = $res[5]; //获取当前时间 $time = time(); //获取当前的小时数 $hour = date('H', $time); //获取星期中的第几天 $whatday = date('w', $time); //当今天是周末的时候或者今天下午两点半 或者今天是节假日 只能选下个交易日 $res = get_holiday_data('shares_holiday'); if ($res == '1' || $whatday == 6 || $whatday == 0 || $hour >= 14) { //如果返回1证明处在节假日之间 //$this->assign('holiday',1); $list['holiday'] = 1; } else { //$this->assign('holiday',0); $list['holiday'] = 1; } ajaxmsg($list); }