->select('stl_id','stl_wat','stl_startime','stl_endtime','stl_type','stl_money','stl_ticket','whether_inv','stl_invoice_number','stl_expressage_number','com.cm_name as company_name')
->select('adm.id','admin_acc as check_code','admin_name as install_name','phone as install_phone','enable as install_is_type','adm.id as admin_id','admin_groupnew','company_id')
$payout_time=M('order_time')->where("serial_number='".$orderListArr['serial_number']."' and is_type='接单时间'")->order('id DESC')->getField('create_time');//获取奖罚起始时间
->leftJoin('user as u','ol.new_customer_id','=','u.id')
->where('ol.id',$request['id'])
->where('is_delete',1)//是否删除:1正常2删除
->select('ol.id','ol.sys_num',"ol.ser_id",'order_num','ol.sys_num as serial_number','customer_id','ol.reminder','p_id','orders_sertatus as service_state','ol.lock_type as lock_state','intall_person','intall_phone','crma_id','ol.distrib_time as create_time','shr_name','shr_phone','shr_sheng','shr_shi','shr_xian','shr_adress','company_id','admin_id')
->select('ol.id','ol.sys_num','order_num','serial_number','p_id','stauas','service_state','intall_person','intall_phone','lock_state','negotiated_price as orli_actual_price','crma_id','reminder_count','ol.create_time','shr_name','shr_phone','shr_sheng','shr_shi','shr_xian','shr_adress')
->leftJoin('order_list_details as old','ol.ord_id','=','old.orli_id')
->where('ol.id',$request['id'])
->where('is_delete',1)
->select('ol.id','ol.serial_number','ol.sys_num','order_num','ord_id','service_state','customer_id','p_id','install_id','intall_person','intall_phone','crma_id','ol.create_time','negotiated_price as orli_actual_price','receive_duration as time_consuming')
$check_code=InstallPerson::whereRaw("admin_id='".$serId."' and check_code>10000000 and check_code<1000000000 and check_code like '".$certification_num."%'")
->orderBy('check_code','DESC')->limit('1')
->value("check_code");
$length=strlen($check_code);
if(in_array($length,[8,9])){
$num=rand(5,99);
$che=$check_code+$num;
$bin=strpos($che,"4");
if($bin){
$code=str_replace("4",'5',$che);
}else{
$code=$che;
}
}else{
$check_code=InstallPerson::whereRaw("check_code like '".$certification_num."%'")