$list=$rqpConn->table('inquiry as a')->join('inquiry_items as b','a.id','=','b.inquiry_id');
...
...
@@ -167,9 +169,13 @@ class InquiryModel extends Model
$list=$list->join('inquiry_items_assign as c','b.id','=','c.inquiry_items_id')
->where('c.assign_uid',$user_id)
->where('b.status',1);// 待报价
}elseif($type==4){
$list=$list->join('inquiry_items_assign as c','b.id','=','c.inquiry_items_id')
->join('inquiry_items_urge as u','b.id','=','u.inquiry_items_id')
->where('c.assign_uid',$user_id);
}
$list=$list->select(DB::Raw("lie_a.inquiry_sn,lie_a.currency,lie_a.status as status_a,lie_a.customer_name,lie_a.create_name,lie_a.create_time as inquiry_ctime,lie_b.*"))
$list=$list->select(DB::Raw("lie_a.inquiry_sn,lie_a.currency,lie_a.status as status_a,lie_a.create_name,lie_a.create_time as inquiry_ctime,lie_b.*"))
->where(function($query)use($input,$type){
foreach($inputas$k=>$v){
$v=trim($v);
...
...
@@ -183,7 +189,6 @@ class InquiryModel extends Model
break;
case"goods_name":
case"brand_name":
case"customer_name":
$query->whereRaw('lie_b.'.$k.' like "'.$v.'%"');
break;
case"status":
...
...
@@ -212,15 +217,21 @@ class InquiryModel extends Model
$time=time()-7200;// 待报价的询价两小时后在询价池展示
$query->orWhereRaw('(lie_b.assign_type=1 and lie_b.status=1 and lie_b.create_time < '.$time.')');