初始化
缺陷:主题配色需要优化整体的同风格
This commit is contained in:
34
app/Models/business/ListModel.php
Normal file
34
app/Models/business/ListModel.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\business;
|
||||
|
||||
use App\BaseApp\BaseBusinessModel;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
/**
|
||||
* 清单(cc_list)
|
||||
*
|
||||
* 一个小程序用户可以有多份清单,登录时会自动建一份「默认清单」。
|
||||
*/
|
||||
class ListModel extends BaseBusinessModel
|
||||
{
|
||||
protected $table = 'list';
|
||||
|
||||
protected $guarded = [];
|
||||
|
||||
public function items(): HasMany
|
||||
{
|
||||
return $this->hasMany(ListItemModel::class, 'list_id', 'id');
|
||||
}
|
||||
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(WxUserModel::class, 'user_id', 'id');
|
||||
}
|
||||
|
||||
public function enterprise(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(EnterpriseModel::class, 'enterprise_id', 'id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user