|
@@ -591,8 +591,6 @@ class Consult extends BaseController
|
|
|
$info['cat_info'] = made($info['cat_id'],[]);
|
|
|
$supplier = Db::name("supplier")->where(["code"=>$info['supplierNo']])->find();
|
|
|
$info['supplierName'] = isset($supplier['name'])?$supplier['name']:"";
|
|
|
- $supplier = Db::name("supplier")->where(["code"=>$info['supplierNo']])->find();
|
|
|
- $info['supplierName'] = isset($supplier['name'])?$supplier['name']:"";
|
|
|
if($info['brand_id']!=0){
|
|
|
$brand=Db::name("brand")->where(["id"=>$info['brand_id']])->find();
|
|
|
$info["brand_name"]=isset($brand['brand_name'])?$brand['brand_name']:"";
|
|
@@ -676,4 +674,49 @@ class Consult extends BaseController
|
|
|
return error_show(1004,$e->getMessage());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ public function bidlist(){
|
|
|
+ $page = isset($this->post['page']) && $this->post['page'] !== "" ? intval($this->post['page']) :"1";
|
|
|
+ $size = isset($this->post['size']) && $this->post['size'] !== "" ? intval($this->post['size']) :"10";
|
|
|
+ $where=[['is_del',"=",0]];
|
|
|
+ $zxNo = isset($this->post['zxNo']) && $this->post['zxNo'] !== "" ? trim($this->post['zxNo']) : "";
|
|
|
+ if ($zxNo !== "") {
|
|
|
+ $where[] = ['zxNo','=',$zxNo];
|
|
|
+ }
|
|
|
+ $infoNo = isset($this->post['infoNo']) && $this->post['infoNo'] !== "" ? trim($this->post['infoNo']) : "";
|
|
|
+ if ($infoNo !== "") {
|
|
|
+ $where[] = ['infoNo','=',$infoNo];
|
|
|
+ }
|
|
|
+ $bidNo = isset($this->post['bidNo']) && $this->post['bidNo'] !== "" ? trim($this->post['bidNo']) : "";
|
|
|
+ if ($bidNo !== "") {
|
|
|
+ $where[] = ['bidNo','=',$bidNo];
|
|
|
+ }
|
|
|
+ $projectNo = isset($this->post['projectNo']) && $this->post['projectNo'] !== "" ? trim($this->post['projectNo']) : "";
|
|
|
+ if ($projectNo !== "") {
|
|
|
+ $zxlist = Db::name("consult_order")->where(["projectNo"=>$projectNo,"is_del"=>0,"is_project"=>1])->column
|
|
|
+ ("zxNo");
|
|
|
+ $where[] = ['zxNo','in',$zxlist];
|
|
|
+ }
|
|
|
+ $count = Db::name('consult_bids')->where($where)->count();
|
|
|
+ $total = ceil($count / $size);
|
|
|
+ $page = $page >= $total ? $total : $page;
|
|
|
+ $list =Db::name('consult_bids')->where($where)->page($page,$size)->select();
|
|
|
+ $data=[];
|
|
|
+ foreach ($list as $value){
|
|
|
+ $value['can']= isset($value['cat_id']) && $value['cat_id'] !=0 ? made($value['cat_id']):[];
|
|
|
+ $unit =Db::name("unit")->where(["id"=>$value['unit_id']])->find();
|
|
|
+ $value['unit'] = isset($unit['unit'])?$unit['unit']:'';
|
|
|
+ $supplier = Db::name("supplier")->where(["code"=>$value['supplierNo']])->find();
|
|
|
+ $value['supplierName'] = isset($supplier['name'])?$supplier['name']:"";
|
|
|
+ if($value['brand_id']!=0){
|
|
|
+ $brand=Db::name("brand")->where(["id"=>$value['brand_id']])->find();
|
|
|
+ $value["brand_name"]=isset($brand['brand_name'])?$brand['brand_name']:"";
|
|
|
+ }else{
|
|
|
+ $value["brand_name"]="";
|
|
|
+ $value["brand_id"]="";
|
|
|
+ }
|
|
|
+ $data[]=$value;
|
|
|
+ }
|
|
|
+ return app_show(0,"获取成功",['count'=>$count,'list'=>$data]);
|
|
|
+ }
|
|
|
}
|