|
|
@@ -90,41 +90,42 @@ class PayMentService
|
|
|
* @param $channel
|
|
|
* @return bool|mixed
|
|
|
*/
|
|
|
- public static function getServiceByPayMethod($method, $channel,$except_channelName="")
|
|
|
+ public static function getServiceByPayMethod($method, $payAmt,$pay_method)
|
|
|
{
|
|
|
- $except_configKeys=[$except_channelName];
|
|
|
- $switch = Redis::get("recharge_config_switch_{$channel}");
|
|
|
- if ($channel && $switch) {
|
|
|
- $services = DB::connection('write')
|
|
|
- ->table('QPPlatformDB.dbo.ChannelOpenRecharge')
|
|
|
- ->join(
|
|
|
- 'agent.dbo.admin_configs',
|
|
|
- 'admin_configs.id',
|
|
|
- '=',
|
|
|
- 'ChannelOpenRecharge.ConfigID'
|
|
|
- )
|
|
|
- ->where('admin_configs.new_pay_type', $method)
|
|
|
- ->whereNotIn('admin_configs.config_key',$except_configKeys)
|
|
|
- ->where('admin_configs.type', 'pay')
|
|
|
- ->where('admin_configs.status', 1)
|
|
|
- ->where('ChannelOpenRecharge.Status', 1)
|
|
|
- ->where('ChannelOpenRecharge.Channel', $channel)
|
|
|
- ->where('ChannelOpenRecharge.Sort', '>', 0)
|
|
|
- ->selectRaw('admin_configs.config_key, ChannelOpenRecharge.Sort as sort')
|
|
|
- ->get();
|
|
|
- }
|
|
|
- if (!isset($services) || !$services->count()) {
|
|
|
- $services = DB::table('agent.dbo.admin_configs')->where([
|
|
|
- 'new_pay_type' => $method,
|
|
|
- 'type' => 'pay',
|
|
|
- 'status' => 1,
|
|
|
- ])->get();
|
|
|
- if (!$services->count()) {
|
|
|
- Log::error('支付渠道配置异常', [
|
|
|
- 'method' => $method,
|
|
|
- ]);
|
|
|
- return false;
|
|
|
- }
|
|
|
+// $except_configKeys=[$except_channelName];
|
|
|
+// $switch = Redis::get("recharge_config_switch_{$channel}");
|
|
|
+// if ($channel && $switch) {
|
|
|
+// $services = DB::connection('write')
|
|
|
+// ->table('QPPlatformDB.dbo.ChannelOpenRecharge')
|
|
|
+// ->join(
|
|
|
+// 'agent.dbo.admin_configs',
|
|
|
+// 'admin_configs.id',
|
|
|
+// '=',
|
|
|
+// 'ChannelOpenRecharge.ConfigID'
|
|
|
+// )
|
|
|
+// ->where('admin_configs.new_pay_type', $method)
|
|
|
+// ->whereNotIn('admin_configs.config_key',$except_configKeys)
|
|
|
+// ->where('admin_configs.type', 'pay')
|
|
|
+// ->where('admin_configs.status', 1)
|
|
|
+// ->where('ChannelOpenRecharge.Status', 1)
|
|
|
+// ->where('ChannelOpenRecharge.Channel', $channel)
|
|
|
+// ->where('ChannelOpenRecharge.Sort', '>', 0)
|
|
|
+// ->selectRaw('admin_configs.config_key, ChannelOpenRecharge.Sort as sort')
|
|
|
+// ->get();
|
|
|
+// }
|
|
|
+ $services = DB::table('agent.dbo.admin_configs')->where([
|
|
|
+ 'new_pay_type' => $method,
|
|
|
+ 'type' => 'pay',
|
|
|
+ 'status' => 1,
|
|
|
+ ])->whereRaw('pay_types&'.$pay_method.'='.$pay_method)
|
|
|
+ ->where('min_amount', '<=', $payAmt)
|
|
|
+ ->where('max_amount', '>=', $payAmt)
|
|
|
+ ->get();
|
|
|
+ if (!$services->count()) {
|
|
|
+ Log::error('支付渠道配置异常', [
|
|
|
+ 'method' => $method,
|
|
|
+ ]);
|
|
|
+ return false;
|
|
|
}
|
|
|
$matrix = [];
|
|
|
foreach ($services as $v) {
|