This commit is contained in:
mkm 2024-06-21 14:42:46 +08:00
commit fb67788183
3 changed files with 5 additions and 3 deletions

View File

@ -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']);
}
}

View File

@ -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) {

View File

@ -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()