ソースを参照

修改模型名称

jason 4 ヶ月 前
コミット
d2cea780b7

+ 1 - 1
app/admin/controller/shop/CustomerSpec.php

@@ -12,7 +12,7 @@ use app\common\model\StockConfig;
 use think\facade\Db;
 use app\common\model\ProductConfig;
 use app\api\service\SpecService;
-use app\common\model\CustomerSpecBack as CustomerSpecModel;
+use app\common\model\CustomerSpec as CustomerSpecModel;
 
 #[Group("shop/customer_spec")]
 class CustomerSpec extends Backend

+ 3 - 3
app/admin/controller/shop/ShopList.php

@@ -10,7 +10,7 @@ use app\admin\traits\Actions;
 use app\common\model\Customer;
 use app\common\model\User;
 use app\common\model\StockConfig;
-use app\common\model\CustomerSpecBack;
+use app\common\model\CustomerSpec;
 use app\api\service\SpecService;
 use app\common\model\ShopList as ShopListModel;
 
@@ -68,12 +68,12 @@ class ShopList extends Backend
             $type_id = $this->request->get('type_id/d', 0);
             if(empty($ids) || empty($type_id)) return resp_json(0, '参数错误');
             $customer_id = $this->model::where('id', $ids)->value('customer_id');
-            $rows = CustomerSpecBack::alias('a')
+            $rows = CustomerSpec::alias('a')
                 ->leftjoin('product_config b', 'a.product_id=b.id')
                 ->field('a.*,b.title')
                 ->where('a.type_id', $type_id)
                 ->where('a.customer_id', $customer_id)
-                ->where('a.status', CustomerSpecBack::NORMAL)
+                ->where('a.status', CustomerSpec::NORMAL)
                 ->order('a.sort desc')->select();
             return json($rows, 200);
         }

+ 3 - 3
app/api/service/SpecService.php

@@ -7,7 +7,7 @@ use app\common\model\StockConfig;
 use app\common\model\ProductConfig;
 use app\common\model\StockDetail;
 use app\common\model\ShopDelivery;
-use app\common\model\CustomerSpecBack;
+use app\common\model\CustomerSpec;
 /**
  * 录入发货
  */
@@ -82,7 +82,7 @@ class SpecService{
                         'remark'          => '录入出库'
                   ];
                   //根据规格扣除包装箱
-                  $box_id = CustomerSpecBack::where('customer_id', $customer->id)->where('type_id', $item['variety_id'])->where('product_id', $item['spec_id'])->value('box_id');
+                  $box_id = CustomerSpec::where('customer_id', $customer->id)->where('type_id', $item['variety_id'])->where('product_id', $item['spec_id'])->value('box_id');
                   if($box_id){
                         $boxNum = StockDetail::setStockConfigNum($box_id, (string)-$item['num'], StockConfig::PackingBox);
                         $stockData[] = [
@@ -120,7 +120,7 @@ class SpecService{
             StockDetail::setStockConfigNum($delivery->variety_id, bcsub($delivery->weigh, $weight, 2), StockConfig::VarietyName);
 
             //根据规格扣除包装箱
-            $box_id = CustomerSpecBack::where('customer_id', $delivery->customer_id)->where('type_id', $delivery['variety_id'])->where('product_id', $delivery->spec_id)->value('box_id');
+            $box_id = CustomerSpec::where('customer_id', $delivery->customer_id)->where('type_id', $delivery['variety_id'])->where('product_id', $delivery->spec_id)->value('box_id');
             if($box_id){
                   StockDetail::setStockConfigNum($box_id, bcsub((string)$delivery->num, $data['num'], 2), StockConfig::PackingBox);
             }

+ 1 - 1
app/common/model/CustomerSpecBack.php → app/common/model/CustomerSpec.php

@@ -5,7 +5,7 @@ namespace app\common\model;
 
 use think\Model;
 
-class CustomerSpecBack Extends Model
+class CustomerSpec Extends Model
 {
       const NORMAL = 1;
       const DELETE = 0;