后台:
添加服务逻辑的编辑 接口: 添加服务列表 添加服务详情 添加服务点赞、收藏
This commit is contained in:
33
application/admin/model/Moments.php
Normal file
33
application/admin/model/Moments.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use app\common\model\Goods;
|
||||
use think\Model;
|
||||
|
||||
class Moments extends Model
|
||||
{
|
||||
protected $name = 'moments';
|
||||
|
||||
/**
|
||||
* 关联员工(belongsTo:moments 属于 staff,moments.sid = staff.id)
|
||||
*/
|
||||
public function getStaff()
|
||||
{
|
||||
return $this->belongsTo(Staff::class, 'sid', 'id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 关联订单(belongsTo:moments 属于 order,moments.oid = order.id)
|
||||
*/
|
||||
public function getOrder()
|
||||
{
|
||||
return $this->belongsTo(Order::class, 'oid', 'id');
|
||||
}
|
||||
|
||||
//关联产品
|
||||
public function getProduct()
|
||||
{
|
||||
return $this->belongsTo(Goods::class, 'goods_id', 'id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user