作者 王晓刚
1 个管道 的构建 通过 耗费 2 秒

代理人模块

@@ -112,7 +112,6 @@ class MeGuaranteeController extends WeChatBaseController @@ -112,7 +112,6 @@ class MeGuaranteeController extends WeChatBaseController
112 if(!empty($param['status'])){//0为全部1为托管中2为即将到期3为未托管 112 if(!empty($param['status'])){//0为全部1为托管中2为即将到期3为未托管
113 if($param['status'] == 1){ 113 if($param['status'] == 1){
114 $where['o.status'] = ['eq',1]; 114 $where['o.status'] = ['eq',1];
115 - $where['o.user_id'] = ['eq',$user_id];  
116 $where['c.insurer'] = ['eq',$param['insurer']]; 115 $where['c.insurer'] = ['eq',$param['insurer']];
117 // $where['o.order_about_time'] = ['>',$time]; 116 // $where['o.order_about_time'] = ['>',$time];
118 // $where['o.order_expire_time2'] = ['>',$time]; 117 // $where['o.order_expire_time2'] = ['>',$time];
@@ -123,16 +122,24 @@ class MeGuaranteeController extends WeChatBaseController @@ -123,16 +122,24 @@ class MeGuaranteeController extends WeChatBaseController
123 }else if(!empty($param['agent_phone'])){ 122 }else if(!empty($param['agent_phone'])){
124 $whereor = "o.status = 3 and o.order_expire_time2 > ".$time." and c.agent_phone = $param[agent_phone] and c.insurer ="."'"."$insurer"."'"; 123 $whereor = "o.status = 3 and o.order_expire_time2 > ".$time." and c.agent_phone = $param[agent_phone] and c.insurer ="."'"."$insurer"."'";
125 }else{ 124 }else{
  125 + $where['o.user_id'] = ['eq',$user_id];
126 $whereor = "o.user_id = $user_id and o.status = 3 and o.order_expire_time2 > ".$time." and c.insurer ="."'"."$insurer"."'"; 126 $whereor = "o.user_id = $user_id and o.status = 3 and o.order_expire_time2 > ".$time." and c.insurer ="."'"."$insurer"."'";
127 } 127 }
128 }else if($param['status'] == 2){ 128 }else if($param['status'] == 2){
129 $where['o.status'] = ['eq',3]; 129 $where['o.status'] = ['eq',3];
130 - $where['o.user_id'] = ['eq',$user_id];  
131 $where['c.insurer'] = ['eq',$param['insurer']]; 130 $where['c.insurer'] = ['eq',$param['insurer']];
132 $where['o.order_expire_time2'] = ['>',$time]; 131 $where['o.order_expire_time2'] = ['>',$time];
133 $where['o.order_about_time'] = array(array('<',$time),array('>',$time-30*24*60*60));//array(array('gt',1),array('lt',10)) 132 $where['o.order_about_time'] = array(array('<',$time),array('>',$time-30*24*60*60));//array(array('gt',1),array('lt',10))
134 -// $where['o.order_about_time'] = ['>',$time]; 133 + if(!empty($param['application']) && !empty($param['agent_phone'])){
  134 + $whereor = "o.status = 1 and c.insurer = "."'".$insurer."'"." and o.order_about_time < $time and o.order_about_time > ".($time-30*24*60*60)." and o.order_expire_time2 > $time and c.application = "."'"."$param[application]"."'"." and c.agent_phone = $param[agent_phone]";
  135 + }else if(!empty($param['application'])){
  136 + $whereor = "o.status = 1 and c.insurer = "."'".$insurer."'"." and o.order_about_time < $time and o.order_about_time > ".($time-30*24*60*60)." and o.order_expire_time2 > $time and c.application = "."'"."$param[application]"."'"."";
  137 + }else if(!empty($param['agent_phone'])){
  138 + $whereor = "o.status = 1 and c.insurer = "."'".$insurer."'"." and o.order_about_time < $time and o.order_about_time > ".($time-30*24*60*60)." and o.order_expire_time2 > $time and c.agent_phone = $param[agent_phone]";
  139 + }else{
  140 + $where['o.user_id'] = ['eq',$user_id];
135 $whereor = "o.user_id = $user_id and o.status = 1 and c.insurer = "."'".$insurer."'"." and o.order_about_time < $time and o.order_about_time > ".($time-30*24*60*60)." and o.order_expire_time2 > $time"; 141 $whereor = "o.user_id = $user_id and o.status = 1 and c.insurer = "."'".$insurer."'"." and o.order_about_time < $time and o.order_about_time > ".($time-30*24*60*60)." and o.order_expire_time2 > $time";
  142 + }
136 }else if($param['status'] == 3){ 143 }else if($param['status'] == 3){
137 // $where['o.status'] = ['eq',2]; 144 // $where['o.status'] = ['eq',2];
138 // $where['c.insurer'] = ['eq',$param['insurer']]; 145 // $where['c.insurer'] = ['eq',$param['insurer']];