|
@@ -724,6 +724,110 @@ class Consult extends BaseController
|
|
|
$info['bargain'] =$bargain;
|
|
|
return app_show(0,"获取成功",$info);
|
|
|
}
|
|
|
+
|
|
|
+ public function feededit(){
|
|
|
+ $bidNo= isset($this->post['bidNo'])&&$this->post['bidNo']!=""?trim($this->post['bidNo']):"";
|
|
|
+ if($bidNo==""){
|
|
|
+ return error_show(1002,"参数bidNo不能为空");
|
|
|
+ }
|
|
|
+ $bidinfo = Db::name("consult_bids")->where(["bidNo"=>$bidNo,"is_del"=>0])->find();
|
|
|
+ if($bidinfo==false){
|
|
|
+ return error_show(1003,"未找到信息数据");
|
|
|
+ }
|
|
|
+ if($bidinfo['status']>=5){
|
|
|
+ return error_show(1004,"咨询单已确认无法修改");
|
|
|
+ }
|
|
|
+
|
|
|
+ $zxinfo = Db::name("consult_info")->where(["infoNo"=>$bidinfo['infoNo'],"is_del"=>0])->find();
|
|
|
+ if($zxinfo==false){
|
|
|
+ return error_show(1003,"未找到信息数据");
|
|
|
+ }
|
|
|
+ $pname = isset($this->post['pname'])&&$this->post['pname']!=""? trim($this->post['pname']):"";
|
|
|
+ if($pname==""){
|
|
|
+ return error_show(1002,"参数pname不能为空");
|
|
|
+ }
|
|
|
+ $brandid = isset($this->post['brandid'])&&$this->post['brandid']!=""? intval($this->post['brandid']):"";
|
|
|
+// if($brandid==""){
|
|
|
+// return error_show(1002,"参数brandid不能为空");
|
|
|
+// }
|
|
|
+
|
|
|
+ $cat_id = isset($this->post['cat_id'])&&$this->post['cat_id']!=""? trim($this->post['cat_id']):"";
|
|
|
+ if($cat_id==""){
|
|
|
+ return error_show(1002,"参数cat_id不能为空");
|
|
|
+ }
|
|
|
+ $model = isset($this->post['model'])&&$this->post['model']!=""? trim($this->post['model']):"";
|
|
|
+ //$unit = isset($this->post['model'])&&$this->post['model']!=""? trim($this->post['model']):"";
|
|
|
+ $material = isset($this->post['material'])&&$this->post['material']!=""? trim($this->post['material']):"";
|
|
|
+ $unit_id = isset($this->post['unit_id'])&&$this->post['unit_id']!=""? intval($this->post['unit_id']):"";
|
|
|
+ $cost_desc = isset($this->post['cost_desc'])&&$this->post['cost_desc']!=""? trim($this->post['cost_desc']):"";
|
|
|
+ $work_day = isset($this->post['work_day'])&&$this->post['work_day']!=""? intval($this->post['work_day']):"";
|
|
|
+ $delivery_day = isset($this->post['delivery_day'])&&$this->post['delivery_day']!=""? intval($this->post['delivery_day']):"";
|
|
|
+ $good_img = isset($this->post['good_img'])&&$this->post['good_img']!=""? trim($this->post['good_img']):"";
|
|
|
+ $expire_day = isset($this->post['expire_day'])&&$this->post['expire_day']!=""? intval($this->post['expire_day'])
|
|
|
+ :"";
|
|
|
+ $origin_place = isset($this->post['origin_place'])&&$this->post['origin_place']!=""? trim($this->post['origin_place']):"";
|
|
|
+ $supplierNo = isset($this->post['supplierNo'])&&$this->post['supplierNo']!=""? trim($this->post['supplierNo']):"";
|
|
|
+ $pay_way = isset($this->post['pay_way'])&&$this->post['pay_way']!=""? intval($this->post['pay_way']):"";
|
|
|
+ $tax = isset($this->post['tax'])&&$this->post['tax']!=""? trim($this->post['tax']):"";
|
|
|
+ $send_way = isset($this->post['send_way'])&&$this->post['send_way']!=""? intval($this->post['send_way']):"";
|
|
|
+ $metal_id = isset($this->post['metal_id'])&&$this->post['metal_id']!=""? intval($this->post['metal_id']):"";
|
|
|
+ $is_gold_price = isset($this->post['is_gold_price'])&&$this->post['is_gold_price']!=""? intval($this->post['is_gold_price']):"";
|
|
|
+ $config = isset($this->post['config'])&&$this->post['config']!=""? $this->post['config']:"";
|
|
|
+ $weight = isset($this->post['weight'])&&$this->post['weight']!=""? floatval($this->post['weight']):"";
|
|
|
+ $demo_fee = isset($this->post['demo_fee'])&&$this->post['demo_fee']!=""? floatval($this->post['demo_fee']):"";
|
|
|
+ $delivery_fee = isset($this->post['delivery_fee'])&&$this->post['delivery_fee']!=""? floatval($this->post['delivery_fee']):"";
|
|
|
+ $open_fee = isset($this->post['open_fee'])&&$this->post['open_fee']!=""? floatval($this->post['open_fee']):"";
|
|
|
+ $pakge_fee = isset($this->post['pakge_fee'])&&$this->post['pakge_fee']!=""? floatval($this->post['pakge_fee']):"";
|
|
|
+ $nake_fee = isset($this->post['nake_fee'])&&$this->post['nake_fee']!=""? floatval($this->post['nake_fee']):"";
|
|
|
+ $mark_fee = isset($this->post['mark_fee'])&&$this->post['mark_fee']!=""? floatval($this->post['mark_fee']):"";
|
|
|
+ $cert_fee = isset($this->post['cert_fee'])&&$this->post['cert_fee']!=""? floatval($this->post['cert_fee']):"";
|
|
|
+ $cost_fee = isset($this->post['cost_fee'])&&$this->post['cost_fee']!=""? floatval($this->post['cost_fee']):"";
|
|
|
+ $total_fee = isset($this->post['total_fee'])&&$this->post['total_fee']!=""? floatval($this->post['total_fee']):"";
|
|
|
+ $is_diff = isset($this->post['is_diff'])&&$this->post['is_diff']!==""? intval($this->post['is_diff']):"";
|
|
|
+ $supply_area = isset($this->post['supply_area'])&&$this->post['supply_area']!==""? intval($this->post['supply_area']):"";
|
|
|
+ $remark = isset($this->post['remark'])&&$this->post['remark']!=""? trim($this->post['remark']):"";
|
|
|
+ $data=[
|
|
|
+ "good_name"=>$pname,
|
|
|
+ "brand_id"=>$brandid,
|
|
|
+ "cat_id"=>$cat_id,
|
|
|
+ "model"=>$model,
|
|
|
+ "material"=>$material,
|
|
|
+ "unit_id"=>$unit_id,
|
|
|
+ "cost_desc"=>$cost_desc,
|
|
|
+ "work_day"=>$work_day,
|
|
|
+ "delivery_day"=>$delivery_day,
|
|
|
+ "good_img"=>$good_img,
|
|
|
+ "expire_day"=>$expire_day,
|
|
|
+ "origin_place"=>$origin_place,
|
|
|
+ "supplierNo"=>$supplierNo,
|
|
|
+ "pay_way"=>$pay_way,
|
|
|
+ "tax"=>$tax,
|
|
|
+ "send_way"=>$send_way,
|
|
|
+ "metal_id"=>$metal_id,
|
|
|
+ "is_gold_price"=>$is_gold_price,
|
|
|
+ "config"=>$config,
|
|
|
+ "weight"=>$weight,
|
|
|
+ "is_diff"=>$is_diff,
|
|
|
+ "demo_fee"=>$demo_fee,
|
|
|
+ "delivery_fee"=>$delivery_fee,
|
|
|
+ "open_fee"=>$open_fee,
|
|
|
+ "pakge_fee"=>$pakge_fee,
|
|
|
+ "nake_fee"=>$nake_fee,
|
|
|
+ "mark_fee"=>$mark_fee,
|
|
|
+ "cert_fee"=>$cert_fee,
|
|
|
+ "cost_fee"=>$cost_fee,
|
|
|
+ "total_fee"=>$total_fee,
|
|
|
+ "supply_area"=>$supply_area,
|
|
|
+ "remark"=>$remark,
|
|
|
+ "updatetime"=>date("Y-m-d H:i:s")
|
|
|
+ ];
|
|
|
+ $insert= Db::name("consult_bids")->where($bidinfo)->save($data);
|
|
|
+ if($insert){
|
|
|
+ return app_show(0,"编辑成功");
|
|
|
+ }else{
|
|
|
+ return error_show(1004,"编辑失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
public function bargain_add(){
|
|
|
$bidNo = isset($this->post['bidNo'])&& $this->post['bidNo']!=""?trim($this->post['bidNo']):"";
|
|
|
if($bidNo===""){
|
|
@@ -913,4 +1017,78 @@ class Consult extends BaseController
|
|
|
}
|
|
|
return app_show(0,"获取成功",['count'=>$count,'list'=>$data]);
|
|
|
}
|
|
|
+
|
|
|
+ public function feedlist(){
|
|
|
+ $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];
|
|
|
+ }
|
|
|
+ $token = isset($this->post['token'])&& $this->post['token']!='' ? trim($this->post['token']):"";
|
|
|
+ if($token==''){
|
|
|
+ return error_show(1002,"参数token不能为空");
|
|
|
+ }
|
|
|
+ $user =GetUserInfo($token);
|
|
|
+ if(empty($user)||$user['code']!=0){
|
|
|
+ return error_show(1005,"用户数据不存在");
|
|
|
+ }
|
|
|
+ $createrid= isset($user["data"]['id']) ? $user["data"]['id'] : "";
|
|
|
+ $creater= isset($user["data"]['nickname']) ? $user["data"]['nickname'] : "";
|
|
|
+ $where[] = ["createrid","=",$createrid];
|
|
|
+ $list =Db::name('consult_bids')->where($where)->select();
|
|
|
+ $data=[];
|
|
|
+ foreach ($list as $value){
|
|
|
+ $catinfo = Db::name("cat")->where(["id"=>$value['cat_id']])->find();
|
|
|
+
|
|
|
+ $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"]="";
|
|
|
+ }
|
|
|
+ $bidinfo = Db::name("consult_info")->where(["infoNo"=>$value["infoNo"]])->find();
|
|
|
+ $budget = isset($catinfo['order_rate']) ? $catinfo['order_rate']:100;
|
|
|
+ $god=[
|
|
|
+ "metal_id"=>$value['metal_id'],
|
|
|
+ "weight"=>$value["weight"],
|
|
|
+ "demo_fee"=>$value["demo_fee"],
|
|
|
+ "delivery_fee"=>$value["delivery_fee"],
|
|
|
+ "open_fee"=>$value["open_fee"],
|
|
|
+ "packing_fee"=>$value["pakge_fee"],
|
|
|
+ "mark_fee"=>$value["mark_fee"],
|
|
|
+ "nake_fee"=>$value["nake_fee"],
|
|
|
+ "cert_fee"=>$value["cert_fee"],
|
|
|
+ "cost_fee"=>$value["cost_fee"],
|
|
|
+ "num"=>$bidinfo["num"],
|
|
|
+ ];
|
|
|
+ if($value['is_gold_price']==1){
|
|
|
+ $price = GoldPrice($god, $budget/100);
|
|
|
+ }else{
|
|
|
+ $price = GoodPrice($god, $budget/100);
|
|
|
+ }
|
|
|
+ $value['sale_price'] =round($price,2);
|
|
|
+ $data[]=$value;
|
|
|
+ }
|
|
|
+ return app_show(0,"获取成功",$data);
|
|
|
+ }
|
|
|
}
|