Files
lgp-admin-plus-api/app/Models/business/WxUserModel.php
LQ bcf54c2727 初始化
缺陷:主题配色需要优化整体的同风格
2026-08-14 23:21:21 +08:00

42 lines
1.1 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
namespace App\Models\business;
use App\BaseApp\BaseBusinessModel;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
/**
* 小程序用户cc_wx_user
*
* is_p 代理商 / pid 上级代理商 / price_number 价格倍率 / show_price 价格是否可见 /
* template_code 经销商专属装修模板(空=跟随品牌默认)。
* session_key 是微信会话密钥,只能留在服务端,任何接口都不要把它输出出去。
*/
class WxUserModel extends BaseBusinessModel
{
protected $table = 'wx_user';
protected $guarded = [];
protected $hidden = ['session_key'];
public function enterprise(): BelongsTo
{
return $this->belongsTo(EnterpriseModel::class, 'enterprise_id', 'id');
}
/**
* 该代理商名下的下级用户
*/
public function children(): HasMany
{
return $this->hasMany(self::class, 'pid', 'id');
}
public function parent(): BelongsTo
{
return $this->belongsTo(self::class, 'pid', 'id');
}
}