...
|
...
|
@@ -25,25 +25,25 @@ class MeTrusteeshipController extends WeChatBaseController |
|
|
function _initialize()
|
|
|
{
|
|
|
//判断用户是否微信浏览器打开
|
|
|
$this->isWechat();
|
|
|
//$this->isWechat();
|
|
|
//微信授权
|
|
|
parent::_initialize();
|
|
|
$this->checkWeChatUserLogin();
|
|
|
//阻止拉黑用户
|
|
|
$this->ban();
|
|
|
//$this->ban();
|
|
|
}
|
|
|
//进入我的托管页面
|
|
|
public function index(){
|
|
|
$result1 = $this->isRegister();
|
|
|
if($result1['code'] == 40030){
|
|
|
//重定向到注册页面
|
|
|
$this->redirect('user_register_mobile/index');
|
|
|
}
|
|
|
$result2 = $this->isQuestion();
|
|
|
if($result2['code'] == 40031){
|
|
|
//重定向到问卷调查
|
|
|
$this->redirect('question/index');
|
|
|
}
|
|
|
// $result1 = $this->isRegister();
|
|
|
// if($result1['code'] == 40030){
|
|
|
// //重定向到注册页面
|
|
|
// $this->redirect('user_register_mobile/index');
|
|
|
// }
|
|
|
// $result2 = $this->isQuestion();
|
|
|
// if($result2['code'] == 40031){
|
|
|
// //重定向到问卷调查
|
|
|
// $this->redirect('question/index');
|
|
|
// }
|
|
|
$user_id = cmf_get_current_user_id();
|
|
|
$userModel = new UserModel();
|
|
|
$user = $userModel->findUserData(array('id'=>$user_id));
|
...
|
...
|
@@ -68,8 +68,8 @@ class MeTrusteeshipController extends WeChatBaseController |
|
|
$one_collocation_data_four = $orderInfoModel->selectData(array('c.user_id'=>$user_id,'c.insurer'=>!empty($insurer[0]['insurer']) ? $insurer[0]['insurer'] : '','c.insurance_type_id'=>4,'o.order_expire_time'=>['>',time()]));
|
|
|
$one_collocation_data_five = $orderInfoModel->selectData(array('c.user_id'=>$user_id,'c.insurer'=>!empty($insurer[0]['insurer']) ? $insurer[0]['insurer'] : '','c.insurance_type_id'=>5,'o.order_expire_time'=>['>',time()]));
|
|
|
$one_collocation_data_six = $orderInfoModel->selectData(array('c.user_id'=>$user_id,'c.insurer'=>!empty($insurer[0]['insurer']) ? $insurer[0]['insurer'] : '','c.insurance_type_id'=>6,'o.order_expire_time'=>['>',time()]));
|
|
|
$indexServer = new IndexServer();
|
|
|
$one_collocation_data_one = $indexServer->regroup($one_collocation_data_one);
|
|
|
|
|
|
$one_collocation_data_one = $this->regroup($one_collocation_data_one);
|
|
|
dump($one_collocation_data_one);
|
|
|
// dump($one_collocation_data_two);
|
|
|
// dump($one_collocation_data_three);
|
...
|
...
|
@@ -101,7 +101,7 @@ class MeTrusteeshipController extends WeChatBaseController |
|
|
'yes_people_count' => $yes_people_count,
|
|
|
'yes_total_sum' => $yes_main_total_sum+$yes_vice_total_sum,
|
|
|
'insurer' => $insurer,
|
|
|
'one_collocation_data_one' => $indexServer->regroup($one_collocation_data_one),
|
|
|
'one_collocation_data_one' => $one_collocation_data_one,
|
|
|
'one_collocation_data_two' => $one_collocation_data_two,
|
|
|
'one_collocation_data_three' => $one_collocation_data_three,
|
|
|
'one_collocation_data_four' => $one_collocation_data_four,
|
...
|
...
|
@@ -217,4 +217,33 @@ class MeTrusteeshipController extends WeChatBaseController |
|
|
$arr['data'] = $data;
|
|
|
return json_encode($arr);
|
|
|
}
|
|
|
public function regroup($data){
|
|
|
$arr = [];
|
|
|
|
|
|
foreach($data as $key => $vo){
|
|
|
$result1 = [];
|
|
|
$result2 = [];
|
|
|
|
|
|
|
|
|
foreach($vo as $k=>$v){
|
|
|
|
|
|
$result1[] = $v['insurance_price'];
|
|
|
if($v['order_expire_time'] > time()){
|
|
|
$result2[] = $v['insurance_price'];
|
|
|
}
|
|
|
}
|
|
|
|
|
|
$arr['name'] = $key;
|
|
|
$arr['sum'] = array_sum($result2);
|
|
|
if(empty($result1)){//未有保单
|
|
|
$arr['type'] = 1;
|
|
|
}else if(empty($result2)){//保障缺失
|
|
|
$arr['type'] = 2;
|
|
|
}else{
|
|
|
$arr['type'] = 3;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return $arr;
|
|
|
}
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|