重构初始化

This commit is contained in:
技术老胡
2026-04-15 11:45:46 +08:00
parent 72d72d735b
commit 7612026773
381 changed files with 28287 additions and 14717 deletions

View File

@@ -0,0 +1,44 @@
<?php
namespace app\repository\ops\log;
use app\common\base\BaseRepository;
use app\model\admin\ChannelNotifyLog;
/**
* 渠道通知日志仓库。
*/
class ChannelNotifyLogRepository extends BaseRepository
{
/**
* 构造函数,注入对应模型。
*/
public function __construct()
{
parent::__construct(new ChannelNotifyLog());
}
/**
* 根据通知单号查询渠道通知日志。
*/
public function findByNotifyNo(string $notifyNo, array $columns = ['*'])
{
return $this->model->newQuery()
->where('notify_no', $notifyNo)
->first($columns);
}
/**
* 根据渠道、通知类型和业务单号查询重复通知记录。
*/
public function findDuplicate(int $channelId, int $notifyType, string $bizNo, array $columns = ['*'])
{
return $this->model->newQuery()
->where('channel_id', $channelId)
->where('notify_type', $notifyType)
->where('biz_no', $bizNo)
->first($columns);
}
}

View File

@@ -0,0 +1,33 @@
<?php
namespace app\repository\ops\log;
use app\common\base\BaseRepository;
use app\model\admin\PayCallbackLog;
/**
* 支付回调日志仓库。
*/
class PayCallbackLogRepository extends BaseRepository
{
/**
* 构造函数,注入对应模型。
*/
public function __construct()
{
parent::__construct(new PayCallbackLog());
}
/**
* 根据支付单号查询回调日志列表。
*/
public function listByPayNo(string $payNo, array $columns = ['*'])
{
return $this->model->newQuery()
->where('pay_no', $payNo)
->orderByDesc('id')
->get($columns);
}
}

View File

@@ -0,0 +1,33 @@
<?php
namespace app\repository\ops\stat;
use app\common\base\BaseRepository;
use app\model\admin\ChannelDailyStat;
/**
* 通道日统计仓库。
*/
class ChannelDailyStatRepository extends BaseRepository
{
/**
* 构造函数,注入对应模型。
*/
public function __construct()
{
parent::__construct(new ChannelDailyStat());
}
/**
* 根据通道和日期查询统计记录。
*/
public function findByChannelAndDate(int $channelId, string $statDate, array $columns = ['*'])
{
return $this->model->newQuery()
->where('channel_id', $channelId)
->where('stat_date', $statDate)
->first($columns);
}
}