12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <?php
- namespace app\controller\api\pc;
- use app\Request;
- use app\services\pc\HomeServices;
- use app\services\other\QrcodeServices;
- use crmeb\services\SystemConfigService;
- class HomeController
- {
-
- protected $services;
-
- public function __construct(HomeServices $services)
- {
- $this->services = $services;
- }
-
- public function getBanner()
- {
- $list = sys_data('pc_home_banner');
- return app('json')->successful(compact('list'));
- }
-
- public function getCategoryProduct(Request $request)
- {
- $data = $this->services->getCategoryProduct((int)$request->uid());
- return app('json')->successful($data);
- }
-
- public function getProductPhoneBuy()
- {
- $data = SystemConfigService::more(['product_phone_buy_url', 'site_url']);
- return app('json')->successful(['phone_buy' => $data['product_phone_buy_url'] ?? 1, 'sit_url' => $data['site_url'] ?? '']);
- }
-
- public function getPayVipCode()
- {
- $type = sys_config('product_phone_buy_url', 1);
- $url = '/pages/annex/vip_paid/index';
- $name = "wechat_pay_vip_code.png";
-
- $QrcodeService = app()->make(QrcodeServices::class);
- if ($type == 1) {
- $codeUrl = $QrcodeService->getWechatQrcodePath($name, $url, false, false);
- } else {
-
- $codeUrl = $QrcodeService->getRoutineQrcodePath(0, 0, 5, [], false);
- }
- return app('json')->successful(['url' => $codeUrl ? $codeUrl : '']);
- }
- }
|