优化代码

master
ELF 4 years ago
parent dd7068e3ae
commit 773068b57c

@ -736,24 +736,6 @@ class TestResourceController extends ThinkController
M('test_resource','tab_')->rollback();//回滚
$this->error('数据有误');
}
// $max_quota=$this->max_quota($support['game_id'],$support['server_name']);//最大申请额度
// if(count($ids)>1){
// $map_s['game_id']=$support['game_id'];
// $map_s['server_name']=$support['server_name'];
// $map_s['id'] =['in',$ids];
// $count=M('support','tab_')->where($map_s)->count();
// $max_quota = floor($max_quota/$count);
// }
// if(I('support_num') > $max_quota){
// M('support','tab_')->rollback();//回滚
// $this->ajaxReturn(['status'=>0,'msg'=>'扶持申请额度不足,最大额度:'.$max_quota]);
// }
// if($support['promote_id'] !=$_SESSION['onethink_home']['promote_auth']['pid'] || empty($support) ){
// M('test_resource','tab_')->rollback();//回滚
// $this->error('申请失败');
// }
$data['game_id']=$support['game_id'];
$data['game_name']=$support['game_name'];
@ -831,7 +813,6 @@ class TestResourceController extends ThinkController
unset($_REQUEST['start']);unset($_REQUEST['end']);
}
// $map['promote_id']=$_SESSION['onethink_home']['promote_auth']['pid'];
$data=M('test_resource','tab_')->where($map)->order('id desc')->page($page,$row)->select();
$count=M('test_resource','tab_')->field('id')->where($map)->select();
$count = count($count);

@ -2010,10 +2010,11 @@ function varify_url($url){
}
return $status;
}
//获取当前推广员id
function get_pid()
{
return $_SESSION['onethink_home']['promote_auth']['pid'];
return session('promote_auth.pid');
}
// //计算数组个数用于模板

@ -92,9 +92,8 @@ $config = array(
'SESSION_OPTIONS' => array(
// 'expire' => 3600
'type' => 'Redis',
'prefix' => 'sess_',
'path' => 'tcp://127.0.0.1:6379',
'expire' => 60,
'expire' => 3600,
),
'SESSION_REDIS_EXPIRE' => 3600,
);

@ -112,7 +112,7 @@ class CoinOrderController extends BaseController
$data['pay_type'] = $pay_type;
$data['order_number'] = $order_no;
$data['promote_id'] = get_pid();
$data['promote_account'] = $_SESSION['onethink_home']['promote_auth']['account'];
$data['promote_account'] = session('promote_auth.account');
$data['create_time'] = time();
$data['discount'] = "0";
if($pay_type==1){ // 在线转账
@ -157,7 +157,7 @@ class CoinOrderController extends BaseController
recordPromoteLogs('平台币管理','提交充值订单');
$this->ajaxReturn(['status'=>1,'info'=>'充值提交成功','pay_type'=>$pay_type,'trade_no'=>$order_no,'time'=>1000],"JSON");
}else{
$account = $_SESSION['onethink_home']['promote_auth']['account'];
$account = session('promote_auth.account');
$bank_list = M("bank","tab_")->select();
$this->meta_title = "平台币充值";
$this->assign("account",$account);

@ -421,11 +421,11 @@ class TestResourceController extends BaseController
$data['apply_resource']=I('apply_resource')[$i];
$data['apply_remark']=I('apply_remark')[$i];
$data['apply_name']=$_SESSION['onethink_home']['promote_auth']['account'];
$data['apply_id']=$_SESSION['onethink_home']['promote_auth']['pid'];
$data['apply_name'] = session('promote_auth.account');
$data['apply_id'] = session('promote_auth.pid');
$data['promote_id']=$_SESSION['onethink_home']['promote_auth']['pid'];
$data['promote_account']=$_SESSION['onethink_home']['promote_auth']['account'];
$data['promote_id'] = session('promote_auth.pid');
$data['promote_account'] = session('promote_auth.account');
$data['create_time']=time();
$data['apply_type']=0;
@ -603,8 +603,8 @@ class TestResourceController extends BaseController
$data['apply_resource']=I('apply_resource');
$data['apply_remark']=I('apply_remark');
$data['apply_name']=$_SESSION['onethink_home']['promote_auth']['account'];
$data['apply_id']=$_SESSION['onethink_home']['promote_auth']['pid'];
$data['apply_name'] = session('promote_auth.account');
$data['apply_id'] = session('promote_auth.pid');
$data['promote_id']=session("promote_auth.pid");
$data['promote_account']=session("promote_auth.account");

@ -175,7 +175,7 @@ class WithdrawController extends BaseController
{
$dbres = M("company_statement_pool","tab_")->field("id,verify_status,verify_log")->where("id = {$id}")->find();
$dbres['verify_log'] = json_decode($dbres['verify_log'],true);
$dbres['verify_log'][$op_pre.'_user']=$_SESSION['onethink_home']['promote_auth']['account'];
$dbres['verify_log'][$op_pre.'_user'] = session('promote_auth.account');
$dbres['verify_log'][$op_pre.'_time']=date("Y-m-d H:i:s");
$dbres['verify_log'] = json_encode($dbres['verify_log']);
$dbres['verify_status']=$change_status;

@ -11,7 +11,7 @@ class Ipa365Controller extends BaseController{
public $userinfo;
public function __construct() {
$this->userinfo = $_SESSION['onethink_home']['user_auth'];
$this->userinfo = session('user_auth');
parent::__construct();
}

Loading…
Cancel
Save