Browse Source

Merge branch 'version1.5' of wugg/phpstock into master-online

wugg 3 năm trước cách đây
mục cha
commit
47199472f8

+ 1 - 0
app/admin/controller/After.php

@@ -795,6 +795,7 @@ class After extends \app\BaseController
                 return error_show(1005,"参数post_fee不能为空");
                 return error_show(1005,"参数post_fee不能为空");
             }
             }
         }
         }
+        Db::startTrans();
         try {
         try {
             $returninfo = Db::name("order_returninfo")->where(["returnCode"=>$bkcode])->find();
             $returninfo = Db::name("order_returninfo")->where(["returnCode"=>$bkcode])->find();
             if($returninfo==false){
             if($returninfo==false){

+ 10 - 7
app/admin/controller/Consult.php

@@ -601,8 +601,8 @@ class Consult extends Base
         $mark_fee = isset($this->post['mark_fee'])&&$this->post['mark_fee']!==""? floatval($this->post['mark_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']):"";
         $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']):"";
         $cost_fee = isset($this->post['cost_fee'])&&$this->post['cost_fee']!==""? floatval($this->post['cost_fee']):"";
-        if($nake_fee==="" ||$nake_fee==0 ){
-            return error_show(1004,"参数nake_fee不能为空或零");
+        if($nake_fee===""  ){
+            return error_show(1004,"参数nake_fee不能为空");
             }
             }
         $is_diff = isset($this->post['is_diff'])&&$this->post['is_diff']!==""? intval($this->post['is_diff']):"";
         $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']):"";
         $supply_area = isset($this->post['supply_area'])&&$this->post['supply_area']!==""? intval($this->post['supply_area']):"";
@@ -767,11 +767,14 @@ class Consult extends Base
                                 $count = Db::name("project_info")->where(["projectNo"=>$projectinfo['projectNo'],"status"=>1])
                                 $count = Db::name("project_info")->where(["projectNo"=>$projectinfo['projectNo'],"status"=>1])
                                     ->count();
                                     ->count();
                                 if($count==0){
                                 if($count==0){
-                                    $proc =Db::name("project")->where(["projectNo"=>$projectinfo['projectNo'],"status"=>1])->save
-                                    (["status"=>2,"updatetime"=>date("Y-m-d H:i:s")]);
-                                    if($proc==false){
-                                        Db::rollback();
-                                        return error_show(1006,"项目反馈失败");
+                                    $projetc =Db::name("project")->where(["projectNo"=>$projectinfo['projectNo'],"status"=>1])->find();
+                                    if($projetc!=false){
+                                        $proc =Db::name("project")->where(["projectNo"=>$projectinfo['projectNo'],"status"=>1])->save
+                                        (["status"=>2,"updatetime"=>date("Y-m-d H:i:s")]);
+                                        if($proc==false){
+                                            Db::rollback();
+                                            return error_show(1006,"项目反馈失败");
+                                        }
                                     }
                                     }
                                 }
                                 }
                             }
                             }

+ 8 - 0
app/admin/controller/Purch.php

@@ -597,6 +597,14 @@ class Purch extends Base
         $int= isset($goon['cat_id']) && $goon['cat_id'] !=0 ? made($goon['cat_id']):[];
         $int= isset($goon['cat_id']) && $goon['cat_id'] !=0 ? made($goon['cat_id']):[];
         $idinf['can']=$int;
         $idinf['can']=$int;
         $idinf['order_type']=$dn['order_type'];
         $idinf['order_type']=$dn['order_type'];
+
+        //取出销售的工差单信息
+        $diff = Db::name('sale_diff')->field('id,customer_remark,is_act,remark')->where('cgd_diffid',$id)->find();
+
+        $idinf['diff_customer_remark']=$diff['customer_remark'];
+        $idinf['diff_is_act']=$diff['is_act'];
+        $idinf['diff_remark']=$diff['remark'];
+
        return  app_show(0,"获取成功",$idinf);
        return  app_show(0,"获取成功",$idinf);
 
 
     }
     }

+ 14 - 4
app/admin/controller/Sale.php

@@ -152,8 +152,6 @@ class Sale extends Base
         }
         }
         $remark =isset($this->post['remark']) && $this->post['remark'] !=="" ?trim($this->post['remark']):"";
         $remark =isset($this->post['remark']) && $this->post['remark'] !=="" ?trim($this->post['remark']):"";
 
 
-        $proofid= isset($this->post['proof_id'])&&$this->post['proof_id']===""?intval($this->post['proof_id']):"0";
-
         $apply_id =GetUserInfo($token);
         $apply_id =GetUserInfo($token);
         if(empty($apply_id)||$apply_id['code']!=0){
         if(empty($apply_id)||$apply_id['code']!=0){
             return error_show(1002,"申请人数据不存在");
             return error_show(1002,"申请人数据不存在");
@@ -189,7 +187,6 @@ class Sale extends Base
                 "remark"=>$remark,
                 "remark"=>$remark,
                 "is_stock"=>$is_stock,
                 "is_stock"=>$is_stock,
                 "is_activity"=>$is_activity===""?0:$is_activity,
                 "is_activity"=>$is_activity===""?0:$is_activity,
-                "proof_id"=>$proofid,
                 "order_type"=>$order_type,
                 "order_type"=>$order_type,
 //                "poNo"=>$poNo,
 //                "poNo"=>$poNo,
                 "workNo"=>$workNo,
                 "workNo"=>$workNo,
@@ -968,6 +965,19 @@ class Sale extends Base
                 Db::rollback();
                 Db::rollback();
                 return error_show(1002, "项目订单生成失败");
                 return error_show(1002, "项目订单生成失败");
             }
             }
+            $consult =Db::name('consult_order')->where(["projectNo"=>$project['projectNo']])->find();
+            if($consult!=false){
+                $up=Db::name("consult_info")->where(['zxNo'=>$consult['zxNo'],"is_del"=>0,"status"=>1])->select()
+                    ->toArray();
+                if(!empty($up)){
+                    $staar=Db::name("consult_info")->where(['zxNo'=>$consult['zxNo'],"is_del"=>0,"status"=>1])->save
+                    (["status"=>2,"updatetime"=>date("Y-m-d H:i:s")]);
+                    if($staar==false){
+                        Db::rollback();
+                        return error_show(1002, "项目咨询单招标结束失败");
+                    }
+                }
+            }
             Db::commit();
             Db::commit();
             return app_show(0, "咨询订单生成成功");
             return app_show(0, "咨询订单生成成功");
         }catch (\Exception $e){
         }catch (\Exception $e){
@@ -2985,7 +2995,7 @@ class Sale extends Base
             return error_show(1002, "未找到商品数据");
             return error_show(1002, "未找到商品数据");
         }
         }
 
 
-        $stock = 0;
+        $stock = 9999;//默认库存数为9999,无实际意义,表示库存不限,只有库存商品才需要去数据库里查验可用库存
         if ($ct['is_stock'] == 1) {
         if ($ct['is_stock'] == 1) {
             $good_stock = Db::name("good_stock")->where(["spuCode" => $ct['spuCode'], "is_del" => 0])->find();
             $good_stock = Db::name("good_stock")->where(["spuCode" => $ct['spuCode'], "is_del" => 0])->find();
             $stock = isset($good_stock['usable_stock']) ? $good_stock['usable_stock'] : "0";
             $stock = isset($good_stock['usable_stock']) ? $good_stock['usable_stock'] : "0";