管理员新增渠道channel_id和代理angent_id

This commit is contained in:
2026-03-19 18:04:52 +08:00
parent 3556ea42dd
commit 019b536a89
10 changed files with 107 additions and 6 deletions

View File

@@ -21,6 +21,8 @@ use support\think\Db;
* @property string $password 密码密文
* @property string $salt 密码盐
* @property string $status 状态:enable=启用,disable=禁用
* @property string $agent_id 代理ID关联渠道
* @property int $channel_id 渠道ID
*/
class Admin extends Model
{
@@ -64,4 +66,12 @@ class Admin extends Model
{
return $this->where(['id' => $uid])->update(['password' => hash_password($newPassword), 'salt' => '']);
}
/**
* 关联渠道
*/
public function channel(): \think\model\relation\BelongsTo
{
return $this->belongsTo(\app\common\model\ChannelManage::class, 'channel_id', 'id');
}
}