123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- <?php
- namespace app\controller\admin\v1\order;
- use app\controller\admin\AuthController;
- use app\services\order\OtherOrderServices;
- use app\services\other\QrcodeServices;
- use crmeb\utils\Canvas;
- use think\facade\App;
- class OtherOrder extends AuthController
- {
-
- public function __construct(App $app, OtherOrderServices $service)
- {
- parent::__construct($app);
- $this->services = $service;
- }
-
- public function scan_list()
- {
- $where = $this->request->getMore([
- ['order_id', ''],
- ['add_time', ''],
- ['name', ''],
- ['page', 1],
- ['limit', 20],
- ]);
- $data = $this->services->getScanOrderList($where);
- return $this->success($data);
- }
-
- public function offline_scan()
- {
- [$type] = $this->request->getMore([
- ['type', 1]
- ], true);
-
- $weixinPage = "/pages/annex/offline_pay/index";
- $weixinFileName = "wechat_offline_scan.png";
-
- $QrcodeService = app()->make(QrcodeServices::class);
- $wechatQrcode = $QrcodeService->getWechatQrcodePath($weixinFileName, $weixinPage, false, false);
-
- $routineQrcode = $QrcodeService->getRoutineQrcodePath(4, 6, 3, [], false);
- $qrcod = ['wechat' => $wechatQrcode, 'routine' => $routineQrcode];
- if ($type) {
-
- $canvas = Canvas::instance();
- $path = 'uploads/offline/';
- $imageType = 'jpg';
- $siteUrl = sys_config('site_url');
- $canvas->setImageUrl(public_path() . 'statics/qrcode/offlines.jpg')->setImageHeight(730)->setImageWidth(500)->pushImageValue();
- foreach ($qrcod as $k => $v) {
- if ($v) {
- $name = 'offline_' . $k;
- $canvas->setImageUrl($v)->setImageHeight(344)->setImageWidth(344)->setImageLeft(76)->setImageTop(120)->pushImageValue();
- $image = $canvas->setFileName($name)->setImageType($imageType)->setPath($path)->setBackgroundWidth(500)->setBackgroundHeight(720)->starDrawChart();
- $data[$k] = $image ? $siteUrl . '/' . $image : '';
- } else {
- $data[$k] = "";
- }
- }
- } else {
- $data = ['wechat' => $wechatQrcode, 'routine' => $routineQrcode];
- }
- return $this->success($data);
- }
- }
|