Update Order.php

This commit is contained in:
邹景立 2021-05-08 15:45:03 +08:00
parent 6baecf52d0
commit 8faf8827ff

View File

@ -295,9 +295,6 @@ class Order extends Auth
/** /**
* 获取支付支付数据 * 获取支付支付数据
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/ */
public function channel() public function channel()
{ {
@ -305,11 +302,11 @@ class Order extends Auth
$payments = $this->app->db->name('ShopOrder')->where($data)->value('payment_allow'); $payments = $this->app->db->name('ShopOrder')->where($data)->value('payment_allow');
if (empty($payments)) $this->error('获取订单支付参数失败'); if (empty($payments)) $this->error('获取订单支付参数失败');
// 读取支付通道配置 // 读取支付通道配置
$query = $this->app->db->name('BaseUserPayment')->field('type,code,name,cover,content')->order('sort desc,id desc'); $query = $this->app->db->name('BaseUserPayment')->where(['status' => 1, 'deleted' => 0]);
$query->where(['status' => 1, 'deleted' => 0])->whereIn('code', str2arr($payments))->whereIn('type', PaymentService::getTypeApi($this->type)); $query->whereIn('code', str2arr($payments))->whereIn('type', PaymentService::getTypeApi($this->type));
$this->success('获取支付参数数据', $query->withAttr('content', function ($content) { $result = $query->order('sort desc,id desc')->column('type,code,name,cover,content', 'code');
return json_decode($content, true); foreach ($result as &$vo) $vo['content'] = ['voucher_qrcode' => json_decode($vo['content'])->voucher_qrcode ?? ''];
})->select()->toArray()); $this->success('获取支付参数数据', array_values($result));
} }
/** /**