mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
修改订单模型
This commit is contained in:
parent
9bbe01a4b8
commit
c10936ab9e
@ -3,6 +3,7 @@
|
|||||||
namespace app\data\model;
|
namespace app\data\model;
|
||||||
|
|
||||||
use think\admin\Model;
|
use think\admin\Model;
|
||||||
|
use think\model\relation\HasMany;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商城订单主模型
|
* 商城订单主模型
|
||||||
@ -11,5 +12,21 @@ use think\admin\Model;
|
|||||||
*/
|
*/
|
||||||
class ShopOrder extends Model
|
class ShopOrder extends Model
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* 关联订单商品
|
||||||
|
* @return \think\model\relation\HasMany
|
||||||
|
*/
|
||||||
|
public function items(): HasMany
|
||||||
|
{
|
||||||
|
return $this->hasMany('order_no', 'order_no')->where(['deleted' => 0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联物码数据
|
||||||
|
* @return \think\model\relation\HasMany
|
||||||
|
*/
|
||||||
|
public function sends(): HasMany
|
||||||
|
{
|
||||||
|
return $this->hasMany('order_no', 'order_no')->where(['deleted' => 0]);
|
||||||
|
}
|
||||||
}
|
}
|
@ -3,6 +3,7 @@
|
|||||||
namespace app\data\model;
|
namespace app\data\model;
|
||||||
|
|
||||||
use think\admin\Model;
|
use think\admin\Model;
|
||||||
|
use think\model\relation\HasOne;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商城订单详情模型
|
* 商城订单详情模型
|
||||||
@ -11,5 +12,12 @@ use think\admin\Model;
|
|||||||
*/
|
*/
|
||||||
class ShopOrderItem extends Model
|
class ShopOrderItem extends Model
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* 关联商品数据
|
||||||
|
* @return \think\model\relation\HasOne
|
||||||
|
*/
|
||||||
|
public function goods(): HasOne
|
||||||
|
{
|
||||||
|
return $this->hasOne(ShopGoods::class, 'code', 'goods_code');
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user