mirror of
https://gitee.com/technical-laohu/mpay_v2_webman.git
synced 2026-04-27 12:34:28 +08:00
更新统一使用 PHPDoc + PSR-19 标准注释
This commit is contained in:
@@ -6,12 +6,16 @@ use app\common\base\BaseRepository;
|
||||
use app\model\payment\PaymentChannel;
|
||||
|
||||
/**
|
||||
* 支付通道仓库。
|
||||
* 支付通道基础查询仓库。
|
||||
*
|
||||
* 提供商户通道的启用列表、单条查询和统计概览等基础读方法。
|
||||
*/
|
||||
class PaymentChannelRepository extends BaseRepository
|
||||
{
|
||||
/**
|
||||
* 构造函数,注入对应模型。
|
||||
* 构造方法。
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
@@ -20,6 +24,10 @@ class PaymentChannelRepository extends BaseRepository
|
||||
|
||||
/**
|
||||
* 查询指定商户启用的支付通道。
|
||||
*
|
||||
* @param int $merchantId 商户ID
|
||||
* @param array $columns 字段列表
|
||||
* @return \Illuminate\Database\Eloquent\Collection<int, PaymentChannel> 启用通道列表
|
||||
*/
|
||||
public function enabledByMerchantId(int $merchantId, array $columns = ['*'])
|
||||
{
|
||||
@@ -32,6 +40,11 @@ class PaymentChannelRepository extends BaseRepository
|
||||
|
||||
/**
|
||||
* 根据商户 ID 和通道 ID 查询通道。
|
||||
*
|
||||
* @param int $merchantId 商户ID
|
||||
* @param int $channelId 渠道ID
|
||||
* @param array $columns 字段列表
|
||||
* @return PaymentChannel|null 通道记录
|
||||
*/
|
||||
public function findByMerchantAndId(int $merchantId, int $channelId, array $columns = ['*'])
|
||||
{
|
||||
@@ -43,6 +56,10 @@ class PaymentChannelRepository extends BaseRepository
|
||||
|
||||
/**
|
||||
* 判断通道名称是否已存在。
|
||||
*
|
||||
* @param string $name 通道名称
|
||||
* @param int $ignoreId 需要排除的记录ID
|
||||
* @return bool 是否存在
|
||||
*/
|
||||
public function existsByName(string $name, int $ignoreId = 0): bool
|
||||
{
|
||||
@@ -58,6 +75,9 @@ class PaymentChannelRepository extends BaseRepository
|
||||
|
||||
/**
|
||||
* 统计商户名下的支付通道概览。
|
||||
*
|
||||
* @param int $merchantId 商户ID
|
||||
* @return object{total_count:int, enabled_count:int, self_count:int} 通道统计概览
|
||||
*/
|
||||
public function summaryByMerchantId(int $merchantId): object
|
||||
{
|
||||
@@ -71,6 +91,9 @@ class PaymentChannelRepository extends BaseRepository
|
||||
|
||||
/**
|
||||
* 统计商户下的支付通道数量。
|
||||
*
|
||||
* @param int $merchantId 商户ID
|
||||
* @return int 通道数量
|
||||
*/
|
||||
public function countByMerchantId(int $merchantId): int
|
||||
{
|
||||
@@ -79,3 +102,6 @@ class PaymentChannelRepository extends BaseRepository
|
||||
->count();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -7,11 +7,15 @@ use app\model\payment\PaymentPluginConf;
|
||||
|
||||
/**
|
||||
* 支付插件配置仓库。
|
||||
*
|
||||
* 封装按插件编码读取最新配置的查询方法。
|
||||
*/
|
||||
class PaymentPluginConfRepository extends BaseRepository
|
||||
{
|
||||
/**
|
||||
* 构造函数,注入对应模型。
|
||||
* 构造方法。
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
@@ -20,6 +24,10 @@ class PaymentPluginConfRepository extends BaseRepository
|
||||
|
||||
/**
|
||||
* 根据插件编码查询插件配置。
|
||||
*
|
||||
* @param string $pluginCode 插件编码
|
||||
* @param array $columns 字段列表
|
||||
* @return PaymentPluginConf|null 插件配置记录
|
||||
*/
|
||||
public function findByPluginCode(string $pluginCode, array $columns = ['*'])
|
||||
{
|
||||
@@ -31,3 +39,7 @@ class PaymentPluginConfRepository extends BaseRepository
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -7,11 +7,15 @@ use app\model\payment\PaymentPlugin;
|
||||
|
||||
/**
|
||||
* 支付插件仓库。
|
||||
*
|
||||
* 封装支付插件字典的查询与启用列表读取。
|
||||
*/
|
||||
class PaymentPluginRepository extends BaseRepository
|
||||
{
|
||||
/**
|
||||
* 构造函数,注入对应模型。
|
||||
* 构造方法。
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
@@ -20,6 +24,10 @@ class PaymentPluginRepository extends BaseRepository
|
||||
|
||||
/**
|
||||
* 根据插件编码查询支付插件。
|
||||
*
|
||||
* @param string $code 插件编码
|
||||
* @param array $columns 字段列表
|
||||
* @return PaymentPlugin|null 插件记录
|
||||
*/
|
||||
public function findByCode(string $code, array $columns = ['*']): ?PaymentPlugin
|
||||
{
|
||||
@@ -30,6 +38,9 @@ class PaymentPluginRepository extends BaseRepository
|
||||
|
||||
/**
|
||||
* 获取所有启用的支付插件。
|
||||
*
|
||||
* @param array $columns 字段列表
|
||||
* @return \Illuminate\Database\Eloquent\Collection<int, PaymentPlugin> 启用插件列表
|
||||
*/
|
||||
public function enabledList(array $columns = ['*'])
|
||||
{
|
||||
@@ -41,3 +52,7 @@ class PaymentPluginRepository extends BaseRepository
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -7,11 +7,15 @@ use app\model\payment\PaymentPollGroupBind;
|
||||
|
||||
/**
|
||||
* 商户分组与轮询组绑定仓库。
|
||||
*
|
||||
* 封装路由绑定的启用记录与编排展示查询。
|
||||
*/
|
||||
class PaymentPollGroupBindRepository extends BaseRepository
|
||||
{
|
||||
/**
|
||||
* 构造函数,注入对应模型。
|
||||
* 构造方法。
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
@@ -20,6 +24,11 @@ class PaymentPollGroupBindRepository extends BaseRepository
|
||||
|
||||
/**
|
||||
* 根据商户分组和支付方式查询启用的绑定关系。
|
||||
*
|
||||
* @param int $merchantGroupId 商户分组ID
|
||||
* @param int $payTypeId 支付类型ID
|
||||
* @param array $columns 字段列表
|
||||
* @return PaymentPollGroupBind|null 绑定记录
|
||||
*/
|
||||
public function findActiveByMerchantGroupAndPayType(int $merchantGroupId, int $payTypeId, array $columns = ['*'])
|
||||
{
|
||||
@@ -32,6 +41,9 @@ class PaymentPollGroupBindRepository extends BaseRepository
|
||||
|
||||
/**
|
||||
* 查询商户分组下的路由绑定概览。
|
||||
*
|
||||
* @param int $merchantGroupId 商户分组ID
|
||||
* @return \Illuminate\Database\Eloquent\Collection<int, PaymentPollGroupBind> 绑定概览列表
|
||||
*/
|
||||
public function listSummaryByMerchantGroupId(int $merchantGroupId)
|
||||
{
|
||||
@@ -55,3 +67,7 @@ class PaymentPollGroupBindRepository extends BaseRepository
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -7,11 +7,15 @@ use app\model\payment\PaymentPollGroupChannel;
|
||||
|
||||
/**
|
||||
* 轮询组与通道编排仓库。
|
||||
*
|
||||
* 封装轮询组下通道编排、默认通道清理等查询与更新。
|
||||
*/
|
||||
class PaymentPollGroupChannelRepository extends BaseRepository
|
||||
{
|
||||
/**
|
||||
* 构造函数,注入对应模型。
|
||||
* 构造方法。
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
@@ -20,6 +24,10 @@ class PaymentPollGroupChannelRepository extends BaseRepository
|
||||
|
||||
/**
|
||||
* 查询轮询组下的通道编排列表。
|
||||
*
|
||||
* @param int $pollGroupId 轮询分组ID
|
||||
* @param array $columns 字段列表
|
||||
* @return \Illuminate\Database\Eloquent\Collection<int, PaymentPollGroupChannel> 编排列表
|
||||
*/
|
||||
public function listByPollGroupId(int $pollGroupId, array $columns = ['*'])
|
||||
{
|
||||
@@ -32,6 +40,10 @@ class PaymentPollGroupChannelRepository extends BaseRepository
|
||||
|
||||
/**
|
||||
* 清空轮询组下其他默认通道标记。
|
||||
*
|
||||
* @param int $pollGroupId 轮询分组ID
|
||||
* @param int $ignoreId 需要保留默认标记的记录ID
|
||||
* @return int 受影响行数
|
||||
*/
|
||||
public function clearDefaultExcept(int $pollGroupId, int $ignoreId = 0): int
|
||||
{
|
||||
@@ -47,3 +59,7 @@ class PaymentPollGroupChannelRepository extends BaseRepository
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -11,7 +11,9 @@ use app\model\payment\PaymentPollGroup;
|
||||
class PaymentPollGroupRepository extends BaseRepository
|
||||
{
|
||||
/**
|
||||
* 构造函数,注入对应模型。
|
||||
* 构造方法。
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
@@ -20,6 +22,10 @@ class PaymentPollGroupRepository extends BaseRepository
|
||||
|
||||
/**
|
||||
* 判断轮询组名称是否已存在。
|
||||
*
|
||||
* @param string $groupName 轮询组名称
|
||||
* @param int $ignoreId 需要排除的记录ID
|
||||
* @return bool 是否存在
|
||||
*/
|
||||
public function existsByGroupName(string $groupName, int $ignoreId = 0): bool
|
||||
{
|
||||
@@ -33,3 +39,7 @@ class PaymentPollGroupRepository extends BaseRepository
|
||||
return $query->exists();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -7,11 +7,15 @@ use app\model\payment\PaymentType;
|
||||
|
||||
/**
|
||||
* 支付方式字典仓库。
|
||||
*
|
||||
* 封装支付方式启用列表和按编码查询方法。
|
||||
*/
|
||||
class PaymentTypeRepository extends BaseRepository
|
||||
{
|
||||
/**
|
||||
* 构造函数,注入对应模型。
|
||||
* 构造方法。
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
@@ -20,6 +24,9 @@ class PaymentTypeRepository extends BaseRepository
|
||||
|
||||
/**
|
||||
* 获取所有启用的支付方式。
|
||||
*
|
||||
* @param array $columns 字段列表
|
||||
* @return \Illuminate\Database\Eloquent\Collection<int, PaymentType> 启用支付方式列表
|
||||
*/
|
||||
public function enabledList(array $columns = ['*'])
|
||||
{
|
||||
@@ -31,6 +38,10 @@ class PaymentTypeRepository extends BaseRepository
|
||||
|
||||
/**
|
||||
* 根据支付方式编码查询字典。
|
||||
*
|
||||
* @param string $code 支付方式编码
|
||||
* @param array $columns 字段列表
|
||||
* @return PaymentType|null 支付方式记录
|
||||
*/
|
||||
public function findByCode(string $code, array $columns = ['*']): ?PaymentType
|
||||
{
|
||||
@@ -41,3 +52,7 @@ class PaymentTypeRepository extends BaseRepository
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user