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

去除保险时间字段

@@ -103,6 +103,7 @@ class MeGuaranteeController extends WeChatBaseController @@ -103,6 +103,7 @@ class MeGuaranteeController extends WeChatBaseController
103 if(!empty($param['agent_phone'])){ 103 if(!empty($param['agent_phone'])){
104 $where['c.agent_phone'] = ['eq',$param['agent_phone']]; 104 $where['c.agent_phone'] = ['eq',$param['agent_phone']];
105 } 105 }
  106 + $user_id = cmf_get_current_user_id();
106 $insurer = $param['insurer']; 107 $insurer = $param['insurer'];
107 $time = time(); 108 $time = time();
108 // $where['c.insurer'] = ['eq',$insurer]; 109 // $where['c.insurer'] = ['eq',$insurer];
@@ -114,31 +115,31 @@ class MeGuaranteeController extends WeChatBaseController @@ -114,31 +115,31 @@ class MeGuaranteeController extends WeChatBaseController
114 $where['c.insurer'] = ['eq',$param['insurer']]; 115 $where['c.insurer'] = ['eq',$param['insurer']];
115 $where['o.order_about_time'] = ['>',$time]; 116 $where['o.order_about_time'] = ['>',$time];
116 if(!empty($param['application']) && !empty($param['agent_phone'])){ 117 if(!empty($param['application']) && !empty($param['agent_phone'])){
117 - $whereor = "o.status = 3 and o.order_about_time > ".$time." and c.application = "."'"."$param[application]"."'"." and c.agent_phone = $param[agent_phone] and c.insurer ="."'"."$insurer"."'"; 118 + $whereor = "o.user_id = $user_id and o.status = 3 and o.order_about_time > ".$time." and c.application = "."'"."$param[application]"."'"." and c.agent_phone = $param[agent_phone] and c.insurer ="."'"."$insurer"."'";
118 }else if(!empty($param['application'])){ 119 }else if(!empty($param['application'])){
119 - $whereor = "o.status = 3 and o.order_about_time > ".$time." and c.application = "."'"."$param[application]"."'"." and c.insurer ="."'"."$insurer"."'"; 120 + $whereor = "o.user_id = $user_id and o.status = 3 and o.order_about_time > ".$time." and c.application = "."'"."$param[application]"."'"." and c.insurer ="."'"."$insurer"."'";
120 }else if(!empty($param['agent_phone'])){ 121 }else if(!empty($param['agent_phone'])){
121 - $whereor = "o.status = 3 and o.order_about_time > ".$time." and c.agent_phone = $param[agent_phone] and c.insurer ="."'"."$insurer"."'"; 122 + $whereor = "o.user_id = $user_id and o.status = 3 and o.order_about_time > ".$time." and c.agent_phone = $param[agent_phone] and c.insurer ="."'"."$insurer"."'";
122 }else{ 123 }else{
123 - $whereor = "o.status = 3 and o.order_about_time > ".$time." and c.insurer ="."'"."$insurer"."'"; 124 + $whereor = "o.user_id = $user_id and o.status = 3 and o.order_about_time > ".$time." and c.insurer ="."'"."$insurer"."'";
124 } 125 }
125 }else if($param['status'] == 2){ 126 }else if($param['status'] == 2){
126 $where['o.status'] = ['eq',3]; 127 $where['o.status'] = ['eq',3];
127 $where['c.insurer'] = ['eq',$param['insurer']]; 128 $where['c.insurer'] = ['eq',$param['insurer']];
128 $where['o.order_about_time'] = array(array('<',$time),array('>',$time-30*24*60*60));//array(array('gt',1),array('lt',10)) 129 $where['o.order_about_time'] = array(array('<',$time),array('>',$time-30*24*60*60));//array(array('gt',1),array('lt',10))
129 // $where['o.order_about_time'] = ['>',$time]; 130 // $where['o.order_about_time'] = ['>',$time];
130 - $whereor = "o.status = 1 and c.insurer = "."'".$insurer."'"." and o.order_about_time < $time and o.order_about_time > ".($time-30*24*60*60); 131 + $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);
131 }else if($param['status'] == 3){ 132 }else if($param['status'] == 3){
132 // $where['o.status'] = ['eq',2]; 133 // $where['o.status'] = ['eq',2];
133 // $where['c.insurer'] = ['eq',$param['insurer']]; 134 // $where['c.insurer'] = ['eq',$param['insurer']];
134 if(!empty($param['application']) && !empty($param['agent_phone'])){ 135 if(!empty($param['application']) && !empty($param['agent_phone'])){
135 - $whereor = "o.status = 2 and o.delete_time = 0 or (o.status = 1 and c.insurer ="."'"."$insurer"."'"." and o.order_about_time < ".($time-24*30*60*60)." and o.delete_time = 0) or (o.status = 3 and c.application = "."'"."$param[application]"."'"." and c.agent_phone = $param[agent_phone] and c.insurer ="."'"."$insurer"."'"."and o.delete_time = 0) or (o.status = 3 and o.order_about_time < ".($time-24*30*60*60)." and c.insurer ="."'"."$insurer"."'and o.delete_time = 0)"; 136 + $whereor = "(o.user_id = $user_id and o.status = 2 and o.delete_time = 0) or (o.user_id = $user_id and o.status = 1 and c.insurer ="."'"."$insurer"."'"." and o.order_about_time < ".($time-24*30*60*60)." and o.delete_time = 0) or (o.user_id = $user_id and o.status = 3 and c.application = "."'"."$param[application]"."'"." and c.agent_phone = $param[agent_phone] and c.insurer ="."'"."$insurer"."'"."and o.delete_time = 0) or (o.user_id = $user_id and o.status = 3 and o.order_about_time < ".($time-24*30*60*60)." and c.insurer ="."'"."$insurer"."'and o.delete_time = 0)";
136 }else if(!empty($param['application'])){ 137 }else if(!empty($param['application'])){
137 - $whereor = "o.status = 2 and o.delete_time = 0 or (o.status = 1 and c.insurer ="."'"."$insurer"."'"." and o.order_about_time < ".($time-24*30*60*60)." and o.delete_time = 0) or (o.status = 3 and c.application = "."'"."$param[application]"."'"." and c.insurer ="."'"."$insurer"."'"." and o.delete_time = 0) or (o.status = 3 and o.order_about_time < ".($time-24*30*60*60)." and c.insurer ="."'"."$insurer"."' and o.delete_time = 0)"; 138 + $whereor = "(o.user_id = $user_id and o.status = 2 and o.delete_time = 0) or (o.user_id = $user_id and o.status = 1 and c.insurer ="."'"."$insurer"."'"." and o.order_about_time < ".($time-24*30*60*60)." and o.delete_time = 0) or (o.user_id = $user_id and o.status = 3 and c.application = "."'"."$param[application]"."'"." and c.insurer ="."'"."$insurer"."'"." and o.delete_time = 0) or (o.user_id = $user_id and o.status = 3 and o.order_about_time < ".($time-24*30*60*60)." and c.insurer ="."'"."$insurer"."' and o.delete_time = 0)";
138 }else if(!empty($param['agent_phone'])){ 139 }else if(!empty($param['agent_phone'])){
139 - $whereor = "o.status = 2 and o.delete_time = 0 or (o.status = 1 and c.insurer ="."'"."$insurer"."'"." and o.order_about_time < ".($time-24*30*60*60)." and o.delete_time = 0) or (o.status = 3 and c.agent_phone = $param[agent_phone] and c.insurer ="."'"."$insurer"."'"." and o.delete_time = 0) or (o.status = 3 and o.order_about_time < ".($time-24*30*60*60)." and c.insurer ="."'"."$insurer"."'and o.delete_time = 0)"; 140 + $whereor = "(o.user_id = $user_id and o.status = 2 and o.delete_time = 0) or (o.user_id = $user_id and o.status = 1 and c.insurer ="."'"."$insurer"."'"." and o.order_about_time < ".($time-24*30*60*60)." and o.delete_time = 0) or (o.user_id = $user_id and o.status = 3 and c.agent_phone = $param[agent_phone] and c.insurer ="."'"."$insurer"."'"." and o.delete_time = 0) or (o.user_id = $user_id and o.status = 3 and o.order_about_time < ".($time-24*30*60*60)." and c.insurer ="."'"."$insurer"."'and o.delete_time = 0)";
140 }else{ 141 }else{
141 - $whereor = "o.status = 2 and o.delete_time = 0 or (o.status = 1 and c.insurer ="."'"."$insurer"."'"." and o.order_about_time < ".($time-24*30*60*60)." and o.delete_time = 0) or (o.status = 3 and o.order_about_time < ".($time-24*30*60*60)." and c.insurer ="."'"."$insurer"."')"; 142 + $whereor = "(o.user_id = $user_id and o.status = 2 and o.delete_time = 0) or (o.user_id = $user_id and o.status = 1 and c.insurer ="."'"."$insurer"."'"." and o.order_about_time < ".($time-24*30*60*60)." and o.delete_time = 0) or (o.user_id = $user_id and o.status = 3 and o.order_about_time < ".($time-24*30*60*60)." and c.insurer ="."'"."$insurer"."')";
142 //$whereor = "(o.status = 2 and o.delete_time = 0) or (o.order_expire_time < $time ) or (o.status = 1 and o.order_about_time < ".($time-24*30*60*60)." and o.delete_time = 0) or (o.status = 3 and o.order_about_time < ".($time-24*30*60*60)." and o.delete_time = 0)"; 143 //$whereor = "(o.status = 2 and o.delete_time = 0) or (o.order_expire_time < $time ) or (o.status = 1 and o.order_about_time < ".($time-24*30*60*60)." and o.delete_time = 0) or (o.status = 3 and o.order_about_time < ".($time-24*30*60*60)." and o.delete_time = 0)";
143 } 144 }
144 } 145 }