初始化
缺陷:主题配色需要优化整体的同风格
This commit is contained in:
41
app/Models/business/WxUserModel.php
Normal file
41
app/Models/business/WxUserModel.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user