62 lines
1.2 KiB
PHP
62 lines
1.2 KiB
PHP
<?php
|
|
|
|
|
|
|
|
|
|
namespace app\common\model\system\config;
|
|
|
|
|
|
use app\common\model\BaseModel;
|
|
use app\model\store\StoreConfig;
|
|
use think\model\relation\HasOne;
|
|
|
|
/**
|
|
* Class SystemConfig
|
|
* @package app\common\model\system\config
|
|
* @author xaboy
|
|
* @day 2020-03-30
|
|
*/
|
|
class SystemConfig extends BaseModel
|
|
{
|
|
/**
|
|
* @return string
|
|
* @author xaboy
|
|
* @day 2020-03-30
|
|
*/
|
|
public static function tablePk(): string
|
|
{
|
|
return 'config_id';
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
* @author xaboy
|
|
* @day 2020-03-30
|
|
*/
|
|
public static function tableName(): string
|
|
{
|
|
return 'system_config';
|
|
}
|
|
|
|
/**
|
|
* @return HasOne
|
|
* @author xaboy
|
|
* @day 2020-03-30
|
|
*/
|
|
public function classify()
|
|
{
|
|
return $this->hasOne(SystemConfig::class, 'config_classify_id', 'config_classify_id');
|
|
}
|
|
|
|
/**
|
|
* 一对一关联门店配置表
|
|
* @return \think\model\relation\HasOne
|
|
*/
|
|
public function storeConfig()
|
|
{
|
|
return $this->hasOne(StoreConfig::class, 'key_name', 'menu_name')->field(['key_name', 'type', 'relation_id', 'value'])->bind([
|
|
'store_value' => 'value',
|
|
]);
|
|
}
|
|
}
|