| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- /**
- * @package merchant
- *
- * @author xaboy
- * @day 2020/6/2
- *
- *
- */
- namespace app\controller\api;
- use app\common\model\store\order\StoreGroupOrder;
- use app\controller\api\merchant\sxy\Access;
- use crmeb\services\QrcodeService;
- use crmeb\services\WechatService;
- class AliPay
- {
- public function getPayInfo()
- {
- $groupOrderId = request()->param('groupOrderId');
- $groupOrder = StoreGroupOrder::where('group_order_id', $groupOrderId)->find()->toArray();
- if (!$groupOrder) {
- return app('json')->fail('订单不存在');
- }
- if ($groupOrder['paid'] == 1) {
- return app('json')->fail('订单已支付');
- }
- $access = new Access();
- $res = $access->pay_huifu('ALI','',$groupOrder,'支付宝支付',env('APP_URL')."/api/hf_notify/pay");
- // 更新store_group_order表hf_pay_id,pay_type
- StoreGroupOrder::update(['hf_pay_id' => $res['id'], 'pay_type' => 4], ['group_order_id' => $groupOrderId]);
- // 更新store_order表pay_type
- StoreGroupOrder::update(['pay_type' => 4], ['group_order_id' => $groupOrderId]);
- return app('json')->success($res);
- }
- }
|