54 lines
982 B
PHP
54 lines
982 B
PHP
<?php
|
|
/**
|
|
* @copyright Copyright (c) 2021 勾股工作室
|
|
* @license https://opensource.org/licenses/Apache-2.0
|
|
* @link https://www.gougucms.com
|
|
*/
|
|
namespace app\admin\model;
|
|
|
|
use think\facade\Db;
|
|
use think\model;
|
|
|
|
/**
|
|
*
|
|
* 商城用户表
|
|
*
|
|
*/
|
|
class ShopUser extends Model
|
|
{
|
|
protected $connection = 'shop';
|
|
|
|
// 设置当前模型对应的完整数据表名称
|
|
protected $table = 'eb_user';
|
|
protected $pk = 'uid';
|
|
|
|
/**
|
|
*
|
|
* 用户地址信息
|
|
*
|
|
*/
|
|
public function userAddress()
|
|
{
|
|
return $this->hasOne(InformationUserAddress::class, 'user_id', 'uid');
|
|
}
|
|
|
|
/**
|
|
*
|
|
* 用户家庭信息
|
|
*
|
|
*/
|
|
public function userMsg()
|
|
{
|
|
return $this->hasOne(InformationUserMsg::class, 'user_id', 'uid');
|
|
}
|
|
|
|
/**
|
|
*
|
|
* 关联用户分组表
|
|
*
|
|
*/
|
|
public function userGroup()
|
|
{
|
|
return $this->hasOne(ShopUserGroup::class, 'group_id', 'group_id');
|
|
}
|
|
} |