feat: 初始化雄戈商城服务端代码与Webhook自动部署配置
这个提交包含在:
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\model\shopro\regional_agent;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class Reward extends Model
|
||||
{
|
||||
protected $name = 'shopro_regional_agent_reward';
|
||||
protected $autoWriteTimestamp = true;
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = 'updatetime';
|
||||
|
||||
public function agent()
|
||||
{
|
||||
return $this->belongsTo(Agent::class, 'agent_id', 'id');
|
||||
}
|
||||
|
||||
public function agentUser()
|
||||
{
|
||||
return $this->belongsTo(\app\admin\model\shopro\user\User::class, 'agent_user_id', 'id');
|
||||
}
|
||||
|
||||
public function buyer()
|
||||
{
|
||||
return $this->belongsTo(\app\admin\model\shopro\user\User::class, 'buyer_id', 'id');
|
||||
}
|
||||
|
||||
public function order()
|
||||
{
|
||||
return $this->belongsTo(\app\admin\model\shopro\order\Order::class, 'order_id', 'id');
|
||||
}
|
||||
|
||||
public function orderItem()
|
||||
{
|
||||
return $this->belongsTo(\app\admin\model\shopro\order\OrderItem::class, 'order_item_id', 'id');
|
||||
}
|
||||
|
||||
public function regionalOrder()
|
||||
{
|
||||
return $this->belongsTo(Order::class, 'regional_order_id', 'id');
|
||||
}
|
||||
|
||||
public function getStatusTextAttr($value, $data)
|
||||
{
|
||||
$map = [0 => '待入账', 1 => '已入账', -1 => '已退回'];
|
||||
return $map[$data['status']] ?? '-';
|
||||
}
|
||||
}
|
||||
在新工单中引用
屏蔽一个用户