65 lines
1.5 KiB
PHP
65 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace app\common\model\store;
|
|
|
|
use app\common\model\BaseModel;
|
|
use app\common\model\store_category\StoreCategory;
|
|
use app\common\model\store_product\StoreProduct;
|
|
use app\common\model\store_product_unit\StoreProductUnit;
|
|
use think\model\concern\SoftDelete;
|
|
|
|
/**
|
|
* 门店商品属性值辅助表模型
|
|
* Class StoreBranchProduct
|
|
* @package app\common\model\store_branch_product
|
|
*/
|
|
class StoreBranchProduct extends BaseModel
|
|
{
|
|
use SoftDelete;
|
|
|
|
protected $name = 'store_branch_product';
|
|
protected $deleteTime = 'delete_time';
|
|
public $ignoreLogFields = [
|
|
'top_cate_id',
|
|
'two_cate_id',
|
|
'cate_id',
|
|
'store_name',
|
|
'image',
|
|
'price',
|
|
'vip_price',
|
|
'cost',
|
|
'purchase',
|
|
'total_price',
|
|
'store_info',
|
|
'keyword',
|
|
'bar_code',
|
|
'rose',
|
|
'status',
|
|
'product_type',
|
|
'unit',
|
|
'batch',
|
|
'store_batch',
|
|
'sort',
|
|
'label_id',
|
|
'is_lack',
|
|
'manufacturer_information',
|
|
'status',
|
|
'create_time',
|
|
'update_time',
|
|
];
|
|
|
|
public function unitName()
|
|
{
|
|
return $this->hasOne(StoreProductUnit::class, 'id', 'unit')->bind(['unit_name' => 'name', 'is_bulk']);
|
|
}
|
|
|
|
public function className()
|
|
{
|
|
return $this->hasOne(StoreCategory::class, 'id', 'cate_id')->bind(['class_name' => 'name']);
|
|
}
|
|
|
|
public function store()
|
|
{
|
|
return $this->hasOne(StoreProduct::class, 'id', 'product_id');
|
|
}
|
|
} |