isApiDebug = true; } // 微信授权 public function getWxAuthCode(){ $code = input('post.code'); if(!$code){ return json_encode(["code" => 100, "message" => "缺少必要请求参数!", "data" => ""]); } $config = Config::get('wxmp_config'); $result = get_http_response('https://api.weixin.qq.com/sns/jscode2session', http_build_query([ 'appid' => $config['app_id'], 'secret' => $config['secret'], 'js_code' => $code, 'grant_type' => 'authorization_code', ]), 'get'); if(!$result){ return json_encode(["code" => 100, "message" => "授权失败!", "data" => '']); } $result = json_decode($result, true); return json_encode(["code" => 200, "message" => "success", "data" => ['openid' => $result['openid']]]); } // 订单详情 public function getOrderInfo(){ $order_id = input('order_id'); $is_debug = input('is_debug', 0); if ($is_debug == 1) { $orderId = makeOrderid('Test_WL'); $data = [ 'title' => '产品指南购买', 'amount' => 0.1, 'game_id' => 10, 'order_id' => $orderId, ]; Cache::store('redis')->set('ldzf_order:'.$orderId, json_encode($data), 300); $this->jsonResult(['orderInfo' => $data], 200, 'success'); } if (!$order_id) { $this->jsonResult([], 100, '缺少必要参数:order_id'); } $result = (new LdysPay())->queryOrder($order_id); if ($result['error'] == true) { $this->jsonResult([], 100, '订单不存在或参数有误!'); } $payData = $result['data']; $this->jsonResult(['orderInfo' => $payData], 200, 'success'); } // 获取联动支付订单 public function getPay() { $open_id = input('open_id'); $order_id = input('order_id'); $pay_type = input('pay_type'); $is_debug = input('is_debug', 0); if (!$open_id) { $this->jsonResult([], 100, '缺少必要参数:open_id'); } if (!$order_id) { $this->jsonResult([], 100, '缺少必要参数:order_id'); } if (!$pay_type) { $this->jsonResult([], 100, '缺少必要参数:pay_type'); } if ($is_debug == 1) { $payData = [ 'title' => '测试产品', 'amount' => 0.1, ]; } else { $result = (new LdysPay())->queryOrder($order_id); if ($result['error'] == true) { $this->jsonResult([], 100, '订单不存在或参数有误!'); } $payData = $result['data']; } $payData['open_id'] = $open_id; $payData['order_id'] = $order_id; $result = (new LdysPay())->getWxmpPay($pay_type, $payData); if ($result['code'] == 110) { $this->jsonResult([], 110, $result['msg']); } if ($result['code'] != 200) { $this->jsonResult([], 100, $result['msg']); } // $payData['amount'] = formatFenToYuan($payData['amount']); unset($payData['open_id']); $this->jsonResult(['payInfo' => $result['data']], 200, 'success'); } public function getWxH5Pay() { } // 文章列表 public function getArticleList() { $list = [ [ "id" => 101, "title" => "关于我们", "source" => "祈点", "read_num" => 198, "is_top" => true, ], [ "id" => 102, "title" => "祈点信息技术有限责任公司", "source" => "祈点", "read_num" => 66, "is_top" => false, ] ]; $banner_list = [ // [ // "img" => "http://devsdkapi.".QM_DOMAIN_URL."/static/mp_static/1715311006322.jpg", // "title" => "师出鬼谷《秦时明月沧海》手游人物介绍之剑圣盖聂" // ], [ // "img" => "http://devsdkapi.".QM_DOMAIN_URL."/static/mp_static/1715309868736.jpg", // "title" => "千里挥戈,霸王降临!《秦时明月沧海》手游项羽介绍" // ], [ // "img" => "http://devsdkapi.".QM_DOMAIN_URL."/static/mp_static/1715311040373.jpg", // "title" => "记小本本《我的御剑日记》手游睚眦角色爆料" // ] ]; $this->jsonResult(['list' => $list, 'banner_list' => $banner_list], 200, 'success'); } // 文章详情 public function getArticleInfo() { $id = input('id'); if (!$id) { $this->jsonResult([], 100, '缺少必要参数:id'); } $list = [ 101 => [ "title" => "关于我们", "source" => "祈点", "time" => "2024-04-15", "read_num" => 198, "body" => '

线上通用产品:

- SDK 接入。

- 数据统计汇总。

技术服务产品:


- 技术输出。

- 支付生态输出。


行业应用产品:

- SDK 接入平台。

- CPS SDK 平台。

' ], 102 => [ "title" => "祈点信息技术有限责任公司", "source" => "祈点", "time" => "2024-04-15", "read_num" => 68, "body" => '

祈点信息技术有限责任公司,公司坐落于银湖创新中心,是富阳区招商引资重点企业。公司主要从事互联网相关,集研发、运营、销售、互联网增值业务为一体的综合性互动娱乐企业。公司先后发行了《侠影双剑》 、 《大魔法时代》、《圣剑英灵传》、《唐门六道》、《破碎黎明2》等游戏。

' ], ]; $info = $list[$id]; $this->jsonResult(['info' => $info], 200, 'success'); } // 巨量引擎开放平台 public function oceanengine() { $input = input(); $data = json_encode($input); log_message('## ThreePlatform@oceanengine:' . $data, 'log', LOG_PATH . 'threePlatform/'); } }