Pārlūkot izejas kodu

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

wugg 2 gadi atpakaļ
vecāks
revīzija
1f1783626c
2 mainītis faili ar 8 papildinājumiem un 6 dzēšanām
  1. 1 3
      app/admin/controller/After.php
  2. 7 3
      app/admin/controller/Good.php

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

@@ -12,11 +12,9 @@ use think\facade\Validate;
 //售后
 class After extends Base
 {
-  //  public $post=[];
     public function __construct(App $app)
     {
         parent::__construct($app);
-//        $this->post =$this->request->post();
     }
 
     public function create(){
@@ -62,7 +60,7 @@ class After extends Base
             }
         }
         if($num>$orderout['send_num']-$after_num){
-            return error_show(1004,"可售后数量不足");
+            return error_show(1004,"可售后数量不足");
         }
         $except_code =isset($this->post['except_code']) &&$this->post['except_code']!=''?trim($this->post['except_code']) :"";
         $img = isset($this->post['img']) &&$this->post['img']!=''?trim($this->post['img']) :"";

+ 7 - 3
app/admin/controller/Good.php

@@ -238,15 +238,19 @@ class Good extends Base
         $nakelist = Db::name("good_nake")->where(['spuCode'=>$good_platform['spuCode'],"is_del"=>0])->select()->toArray();
 //        $catinfo = Db::name("cat")->where(["id"=>$data['cat_id']])->find();
 
-        $cat_top_list = made($data['cat_id']);
+        $cat_top_list = $data['cat_info'];
         $cat_top_id = isset($cat_top_list[0]['id']) ? $cat_top_list[0]['id'] : 0;
         // $budget = isset($catinfo['order_rate']) ? $catinfo['order_rate']/100:0;
+        $gold_price=0;
+        if ($data['is_gold_price']==1 && $cat_top_id==6) {
+            $gold_price = Db::name("gold_price1")->where(["type" => $data['noble_metal'], "status" => 1, "is_del" => 0])->order("addtime desc")->value('price', 0);
+        }
+        $data['gold_price'] =$gold_price;
         $nakearry=[];
         if(!empty($nakelist)){
 
             //实时金价
-            $gold_price = Db::name("gold_price1")->where(["type" => $data['noble_metal'], "status" => 1, "is_del" => 0])->order("addtime desc")->value('price', 0);
-            foreach ($nakelist as $value){
+             foreach ($nakelist as $value){
                 $value['sale_price'] =$value['nake_total'];
 
                 //计算最终售价