Browse Source

库存预警采购员字段优化

wufeng 2 years ago
parent
commit
6fd7fa48bd
2 changed files with 9 additions and 10 deletions
  1. 4 5
      app/admin/controller/Check.php
  2. 5 5
      app/admin/controller/Good.php

+ 4 - 5
app/admin/controller/Check.php

@@ -145,12 +145,11 @@ public function __construct(App $app)
                 $value['specinfo'] = $speclist;
 
                 //采购人
-                $value['cgder'] = Db::name('purchease_order')
+                $value['cgder'] = Db::name('supplier')
                     ->where([
-                        'wsm_code'=>$value['wsm_code'],
-                        'spuCode'=>$value['spuCode'],
-                        'is_del'=>0,
-                    ])->value('cgder','');
+                        'code' => $value['supplierNo'],
+                        'is_del' => 0,
+                    ])->value('name', '');
 
                 $data[] = $value;
             }

+ 5 - 5
app/admin/controller/Good.php

@@ -423,13 +423,13 @@ class Good extends Base
                     ->leftJoin('brand b','b.id=g.brand_id')
                     ->leftJoin('unit u','u.id=g.good_unit')
                     ->find();
-                if(empty($good)){
-                    $good=Db::name("good_zixun")
+                if (empty($good)) {
+                    $good = Db::name("good_zixun")
                         ->alias('g')
                         ->field('g.*,b.brand_name,u.unit')
-                        ->where(["g.spuCode"=>$value['spuCode'],"g.is_del"=>0])
-                        ->leftJoin('brand b','b.id=g.brand_id')
-                        ->leftJoin('unit u','u.id=g.good_unit')
+                        ->where(["g.spuCode" => $value['spuCode'], "g.is_del" => 0])
+                        ->leftJoin('brand b', 'b.id=g.brand_id')
+                        ->leftJoin('unit u', 'u.id=g.good_unit')
                         ->find();
                 }