wugg пре 2 година
родитељ
комит
16a5164d59

+ 1 - 1
app/admin/controller/Purch.php

@@ -143,7 +143,7 @@ class Purch extends Base
         $im = Db::name('purchease_back')->where(['cgdNo'=>$data['cgdNo'],'is_del'=>0])->select();
         $var=[];
         foreach ($im as $value){
-            $goon = Db::name('good')->where(['spuCode'=>$value['good_code']])->field("cat_id")->find();
+            $goon = Db::name('good_basic')->where(['spuCode'=>$value['good_code']])->field("cat_id")->find();
             if(empty($goon)){
                 return error_show(1002,"未找到商品数据");
             }

+ 2 - 2
app/admin/controller/Purchback.php

@@ -27,7 +27,7 @@ public function create(){
     if($cg==""){
         return error_show(1002,"未找到采购单数据");
     }
-    $gd= Db::name('good')->where(['good_code'=>$cg['good_code']])->find();
+    $gd= Db::name('good_basic')->where(['spuCode'=>$cg['good_code']])->find();
     if($gd==""){
         return error_show(1002,"未找到商品数据");
     }
@@ -206,7 +206,7 @@ public function info(){
     if(empty($info)){
         return error_show(1002,"未找到数据");
     }
-    $goon = Db::name('good')->where(['good_code'=>$info['good_code']])->field("cat_id")->find();
+    $goon = Db::name('good_basic')->where(['spuCode'=>$info['good_code']])->field("cat_id")->find();
     if(empty($goon)){
         return error_show(1002,"未找到商品数据");
     }

+ 1 - 1
app/admin/controller/Purchin.php

@@ -273,7 +273,7 @@ class Purchin extends BaseController
             return error_show(1004,"未找到数据");
         }
         $dom = Db::name("purchease_order")->where(['cgdNo'=>$info['cgdNo'],'is_del'=>0])->find();
-        $goon = Db::name('good')->where(['spuCode'=>$dom['spuCode']])->field("cat_id")->find();
+        $goon = Db::name('good_basic')->where(['spuCode'=>$dom['spuCode']])->field("cat_id")->find();
         if(empty($goon)){
             return error_show(1002,"未找到商品数据");
         }

+ 17 - 17
app/admin/controller/Resign.php

@@ -134,8 +134,7 @@ class Resign extends BaseController
         if($mark==""){
             return error_show(1004,"参数remark不能为空");
         }
-        $good =Db::name("good")->alias("a")->leftJoin("good_platform b","a.spuCode=b.spuCode")->where([["b.spuCode","=",
-            $good_code],["a.is_del","=",0]])->find();
+        $good =Db::name("good_basic")->where([["spuCode","=",$good_code],["a.is_del","=",0]])->find();
         if($good==false){
             return error_show(1004,"未找到商品数据");
         }
@@ -153,7 +152,7 @@ class Resign extends BaseController
             "spuCode"=>$good['spuCode'],
             "good_name"=>$good['good_name'],
             "good_num"=>$good_num,
-            "skuCode"=>$good['skuCode'],
+//            "skuCode"=>$good['skuCode'],
             "wsm_code"=>'',
             "companyNo"=>$good['companyNo'],
             "supplierNo"=>$good['supplierNo'],
@@ -233,8 +232,7 @@ class Resign extends BaseController
         if(empty($info)){
             return error_show(1002,'未找到数据');
         }
-        $good =Db::name("good_platform")->alias("a")->leftJoin("good b","a.spuCode=b.spuCode")->where([["a.skuCode","=",
-            $info['skuCode']],["a.is_del","=",0]])->find();
+        $good =Db::name("good_basic")->where([["spuCode","=", $info['spuCode']],["is_del","=",0]])->find();
         if($good==false){
             return error_show(1004,"未找到商品数据");
         }
@@ -300,8 +298,7 @@ class Resign extends BaseController
         if($mark==""){
             return error_show(1004,"参数remark不能为空");
         }
-        $good =Db::name("good")->alias("a")->leftJoin("good b","a.spuCode=b.spuCode")->where([["a.skuCode","=",
-            $good_code],["a.is_del","=",0]])->find();
+        $good =Db::name("good_basic")->where([["spuCode","=", $good_code],["is_del","=",0]])->find();
         if($good==false){
             return error_show(1004,"未找到商品数据");
         }
@@ -314,7 +311,7 @@ class Resign extends BaseController
             "spuCode"=>$good_code,
             "good_name"=>$good['good_name'],
             "good_num"=>$good_num,
-            "skuCode"=>$good['skuCode'],
+           // "skuCode"=>$good['skuCode'],
             "companyNo"=>$customer,
             "supplierNo"=>$supplier,
             "file_url"=>$file_url,
@@ -720,8 +717,7 @@ class Resign extends BaseController
         if($info['wsm_code']==""){
             return error_show(1002,'备库仓库不能为空');
         }
-        $good =Db::name("good")->alias("a")->leftJoin("good b","a.spuCode=b.spuCode")->where([["a.skuCode","=",
-            $info['skuCode']],["a.is_del","=",0]])->find();
+        $good =Db::name("good_basic")->where([["spuCode","=",$info['spuCode']],["is_del","=",0]])->find();
         if($good==false){
             return error_show(1004,"未找到商品数据");
         }
@@ -729,6 +725,9 @@ class Resign extends BaseController
         if($supplier==false){
             return error_show(1004,"未找到供应商数据");
         }
+        $goodnake =Db::name("good_nake")->where([["spuCode","=",$info['spuCode']],["is_del","=",0],"min_num","<=",
+            $info['good_num']])->order("min_num desc")->find();
+
         $cgdCode = makeNo("CG");
 
         $cg =["cgdNo"=>$cgdCode,
@@ -739,14 +738,15 @@ class Resign extends BaseController
             "good_code"=>$info['spuCode'],
             "good_name"=>$info['good_name'],
             "good_num"=>$info['good_num'],
-            "good_price"=>$good['sale_price'],
-            "total_fee"=>$good['total_fee'],
-            "pakge_fee"=>$good['packing_fee'],
-            "cert_fee"=>$good['cert_fee'],
+            "good_price"=>$good['nake_total'],
+            "total_fee"=>round($good['nake_total']*$info['good_num'],2),
+            "pakge_fee"=>isset($goodnake['package_fee'])? $goodnake['package_fee']:0,
+            "cert_fee"=>isset($goodnake['cert_fee'])? $goodnake['cert_fee']:0,
             "open_fee"=>$good['open_fee'],
-            "delivery_fee"=>0,
-            "mark_fee"=>$good['mark_fee'],
-            "teach_fee"=>$good['cost_fee'],
+            "delivery_fee"=>isset($goodnake['delivery_fee'])? $goodnake['delivery_fee']:0,
+            "mark_fee"=>isset($goodnake['mark_fee'])? $goodnake['mark_fee']:0,
+            "nake_fee"=>isset($goodnake['nake_fee'])? $goodnake['nake_fee']:0,
+            "teach_fee"=>isset($goodnake['cost_fee'])? $goodnake['cost_fee']:0,
             "demo_fee"=>$good['demo_fee'],
             "diff_weight"=>"0",
             "diff_fee"=>"0",