diff --git a/app/common/model/store_branch_product_attr_value/StoreBranchProductAttrValue.php b/app/common/model/store_branch_product_attr_value/StoreBranchProductAttrValue.php index 31e3e6f99..bd44c55e6 100644 --- a/app/common/model/store_branch_product_attr_value/StoreBranchProductAttrValue.php +++ b/app/common/model/store_branch_product_attr_value/StoreBranchProductAttrValue.php @@ -4,6 +4,7 @@ namespace app\common\model\store_branch_product_attr_value; use app\common\model\BaseModel; +use app\common\model\store_branch_product\StoreBranchProduct; use app\common\model\store_product_attr_value\StoreProductAttrValue; use think\model\concern\SoftDelete; @@ -21,7 +22,7 @@ class StoreBranchProductAttrValue extends BaseModel public function attr() { - return $this->hasOne(StoreProductAttrValue::class, 'unique', 'unique')->bind(['image']); + return $this->hasOne(StoreBranchProduct::class, 'product_id', 'product_id')->bind(['image']); } } diff --git a/app/store/lists/store_product/StoreProductLists.php b/app/store/lists/store_product/StoreProductLists.php index d436fa4d9..64ab5c6e1 100644 --- a/app/store/lists/store_product/StoreProductLists.php +++ b/app/store/lists/store_product/StoreProductLists.php @@ -46,7 +46,7 @@ class StoreProductLists extends BaseAdminDataLists implements ListsSearchInterfa { return StoreBranchProduct::where($this->searchWhere) ->where('store_id', $this->adminInfo['store_id']) - ->field(['id', 'image', 'store_name', 'cate_id', 'price', 'sales', 'stock', 'is_show', 'unit', 'cost','rose','purchase']) + ->field(['id', 'image', 'store_name', 'cate_id', 'price', 'sales', 'stock', 'is_show', 'unit', 'cost','rose','purchase', 'vip_price']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select()->each(function ($item) { diff --git a/app/store/lists/store_product_attr_value/StoreProductAttrValueLists.php b/app/store/lists/store_product_attr_value/StoreProductAttrValueLists.php index e93380f40..b30469d01 100644 --- a/app/store/lists/store_product_attr_value/StoreProductAttrValueLists.php +++ b/app/store/lists/store_product_attr_value/StoreProductAttrValueLists.php @@ -43,7 +43,8 @@ class StoreProductAttrValueLists extends BaseAdminDataLists implements ListsSear public function lists(): array { return StoreBranchProductAttrValue::with('attr')->where($this->searchWhere) - ->field(['id', 'product_id', 'stock', 'unique', 'sales', 'bar_code']) + ->field(['id', 'product_id', 'stock', 'unique', 'sales', 'bar_code' + ]) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select()