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

去除保险时间字段

... ... @@ -103,6 +103,7 @@ class MeGuaranteeController extends WeChatBaseController
if(!empty($param['agent_phone'])){
$where['c.agent_phone'] = ['eq',$param['agent_phone']];
}
$user_id = cmf_get_current_user_id();
$insurer = $param['insurer'];
$time = time();
// $where['c.insurer'] = ['eq',$insurer];
... ... @@ -114,31 +115,31 @@ class MeGuaranteeController extends WeChatBaseController
$where['c.insurer'] = ['eq',$param['insurer']];
$where['o.order_about_time'] = ['>',$time];
if(!empty($param['application']) && !empty($param['agent_phone'])){
$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"."'";
$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"."'";
}else if(!empty($param['application'])){
$whereor = "o.status = 3 and o.order_about_time > ".$time." and c.application = "."'"."$param[application]"."'"." and c.insurer ="."'"."$insurer"."'";
$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"."'";
}else if(!empty($param['agent_phone'])){
$whereor = "o.status = 3 and o.order_about_time > ".$time." and c.agent_phone = $param[agent_phone] and c.insurer ="."'"."$insurer"."'";
$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"."'";
}else{
$whereor = "o.status = 3 and o.order_about_time > ".$time." and c.insurer ="."'"."$insurer"."'";
$whereor = "o.user_id = $user_id and o.status = 3 and o.order_about_time > ".$time." and c.insurer ="."'"."$insurer"."'";
}
}else if($param['status'] == 2){
$where['o.status'] = ['eq',3];
$where['c.insurer'] = ['eq',$param['insurer']];
$where['o.order_about_time'] = array(array('<',$time),array('>',$time-30*24*60*60));//array(array('gt',1),array('lt',10))
// $where['o.order_about_time'] = ['>',$time];
$whereor = "o.status = 1 and c.insurer = "."'".$insurer."'"." and o.order_about_time < $time and o.order_about_time > ".($time-30*24*60*60);
$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);
}else if($param['status'] == 3){
// $where['o.status'] = ['eq',2];
// $where['c.insurer'] = ['eq',$param['insurer']];
if(!empty($param['application']) && !empty($param['agent_phone'])){
$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)";
$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)";
}else if(!empty($param['application'])){
$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)";
$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)";
}else if(!empty($param['agent_phone'])){
$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)";
$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)";
}else{
$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"."')";
$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"."')";
//$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)";
}
}
... ...