商品、订单部分相关代码生成,下一步先把商品搞完再搞订单
This commit is contained in:
26
app/Models/UserCollectModel.php
Normal file
26
app/Models/UserCollectModel.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\BaseApp\BaseModel;
|
||||
|
||||
class UserCollectModel extends BaseModel
|
||||
{
|
||||
|
||||
protected $table = 'user_collect';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $guarded = [];
|
||||
public function product()
|
||||
{
|
||||
return $this->hasOne(ProductModel::class, 'id', 'product_id');
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->hasOne(UserModel::class, 'id', 'user_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user