123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- /**
- * Created by PhpStorm.
- * User: Bear
- * Date: 2019/4/13
- * Time: 上午11:54
- */
- namespace app\clientwebapi\controller;
- use app\common\controller\ClientWebApi;
- use app\main\service\AdminService;
- use app\main\service\AliH5PayService;
- use app\main\service\WebUserService;
- class Alipay extends ClientWebApi
- {
- public function pay()
- {
- if (!WebUserService::instance()->getUserInfo()->id) {
- $this->error("请登录后重试");
- }
- $goods_id = $this->request->request('id');
- $category = $this->request->request('category');
- if(!$goods_id || !$category){
- $this->error("参数错误");
- }
- $channel_id = WebUserService::instance()->getUserInfo()->channel_id;
- $adminInfo = AdminService::instance()->getAdminConfigModel()->getAdminInfo($channel_id);
- $wxpayid = $adminInfo['wxpay_id'];
- $platformid = $adminInfo['platform_id'];
- $result = AliH5PayService::instance()->getPayUrl($goods_id, $category, $platformid, $wxpayid);
- return $result->data;
- }
- }
|