[代理与结算]代理佣金记录

This commit is contained in:
2026-04-15 18:05:56 +08:00
parent 0b0c0ee04a
commit 080ead200b
6 changed files with 239 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
<?php
namespace app\admin\controller\agent;
use app\common\controller\Backend;
use support\Response;
use Webman\Http\Request as WebmanRequest;
/**
* 代理佣金记录
*/
class CommissionRecord extends Backend
{
protected ?object $model = null;
protected string|array $preExcludeFields = ['id', 'create_time', 'update_time'];
protected string|array $quickSearchField = ['id', 'remark'];
protected string|array $defaultSortField = ['id' => 'desc'];
protected string|array $orderGuarantee = ['id' => 'desc'];
protected array $withJoinTable = ['settlementPeriod', 'channel', 'admin'];
protected bool $modelValidate = false;
protected function initController(WebmanRequest $request): ?Response
{
$this->model = new \app\common\model\AgentCommissionRecord();
return null;
}
}

View File

@@ -0,0 +1,38 @@
<?php
namespace app\common\model;
use support\think\Model;
class AgentCommissionRecord extends Model
{
protected $name = 'agent_commission_record';
protected $autoWriteTimestamp = true;
protected $type = [
'create_time' => 'integer',
'update_time' => 'integer',
'settled_at' => 'integer',
'commission_rate' => 'string',
'calc_base_amount' => 'string',
'commission_amount' => 'string',
'status' => 'integer',
];
public function channel(): \think\model\relation\BelongsTo
{
return $this->belongsTo(Channel::class, 'channel_id', 'id');
}
public function admin(): \think\model\relation\BelongsTo
{
return $this->belongsTo(\app\admin\model\Admin::class, 'admin_id', 'id');
}
public function settlementPeriod(): \think\model\relation\BelongsTo
{
return $this->belongsTo(AgentSettlementPeriod::class, 'settlement_period_id', 'id');
}
}