mirror of
https://gitee.com/technical-laohu/mpay_v2_webman.git
synced 2026-04-24 02:54:26 +08:00
重构初始化
This commit is contained in:
44
app/repository/ops/log/ChannelNotifyLogRepository.php
Normal file
44
app/repository/ops/log/ChannelNotifyLogRepository.php
Normal 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
33
app/repository/ops/log/PayCallbackLogRepository.php
Normal file
33
app/repository/ops/log/PayCallbackLogRepository.php
Normal 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
33
app/repository/ops/stat/ChannelDailyStatRepository.php
Normal file
33
app/repository/ops/stat/ChannelDailyStatRepository.php
Normal 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user