From 7f6bb855e3140a61921b9b9cc14a344fbdd13907 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=96=E5=8F=AB?= <392494244@qq.com> Date: Tue, 5 Dec 2023 16:28:46 +0800 Subject: [PATCH] 1 --- app/common/model/food/Table.php | 63 ++++++++++--------- app/store/view/food/shop/table/index.html | 2 +- app/store/view/food/shop/table/qrcode.html | 26 +------- public/temp/food/wechat-table-10001.png | 2 +- .../eb/300fe116b3568a7e80a6c2812b1a38.php | 2 +- 5 files changed, 37 insertions(+), 58 deletions(-) diff --git a/app/common/model/food/Table.php b/app/common/model/food/Table.php index 8d1dc46..6cb40da 100644 --- a/app/common/model/food/Table.php +++ b/app/common/model/food/Table.php @@ -24,10 +24,10 @@ class Table extends BaseModel public function getQrcodeAttr($value,$data) { $qrcode = [ - 'h5' => '', +// 'h5' => '', 'weixin' => '', - 'alipay' => '', - 'qrcode' => '', +// 'alipay' => '', +// 'qrcode' => '', ]; //生成存储路径 if(!file_exists('./temp/food')){ @@ -35,6 +35,7 @@ class Table extends BaseModel } //生成微信小程序码 $wechat_path = '/temp/food/wechat-table-' . $data['table_id'] . '.png'; + if(!is_file('.' . $wechat_path)){ $wx = new Wechat; if($wx->getUnlimitedQRCode($data['applet_id'],$wechat_path,'table-'.$data['shop_id'].'-'.$data['table_id'])){ @@ -43,36 +44,36 @@ class Table extends BaseModel }else{ $qrcode['weixin'] = $wechat_path; } - //如果已经发布H5端代码 - if(is_file('./h5/food/index.html')){ - $h5_path = '/temp/food/h5-table-' . $data['table_id'] . '.png'; - if(!is_file('.' . $h5_path)){ - $writer = new PngWriter(); - $code = CodeMode::create(base_url() . 'h5/food/#/?applet_id=' . $data['applet_id'] . '&q=table-' . $data['shop_id'].'-'.$data['table_id'])->setSize(500); - $result = $writer->write($code); - $result->saveToFile('.' . $h5_path); - } - $qrcode['h5'] = $h5_path; - } +// //如果已经发布H5端代码 +// if(is_file('./h5/food/index.html')){ +// $h5_path = '/temp/food/h5-table-' . $data['table_id'] . '.png'; +// if(!is_file('.' . $h5_path)){ +// $writer = new PngWriter(); +// $code = CodeMode::create(base_url() . 'h5/food/#/?applet_id=' . $data['applet_id'] . '&q=table-' . $data['shop_id'].'-'.$data['table_id'])->setSize(500); +// $result = $writer->write($code); +// $result->saveToFile('.' . $h5_path); +// } +// $qrcode['h5'] = $h5_path; +// } //生成支付宝小程序码 - $alipay_path = '/temp/food/alipay-table-' . $data['shop_id'] . '.png'; - if(!is_file('.' . $alipay_path)){ - $alipay = new Alipay($data['applet_id']); - if($alipay->openAppQrcodeCreate('table-'.$data['shop_id'].'-'.$data['table_id'],$alipay_path)){ - $qrcode['alipay'] = $alipay_path; - } - }else{ - $qrcode['alipay'] = $alipay_path; - } +// $alipay_path = '/temp/food/alipay-table-' . $data['shop_id'] . '.png'; +// if(!is_file('.' . $alipay_path)){ +// $alipay = new Alipay($data['applet_id']); +// if($alipay->openAppQrcodeCreate('table-'.$data['shop_id'].'-'.$data['table_id'],$alipay_path)){ +// $qrcode['alipay'] = $alipay_path; +// } +// }else{ +// $qrcode['alipay'] = $alipay_path; +// } //生成小程序聚合码 - $qrcode_path = '/temp/food/qrcode-table-' . $data['shop_id'] . '.png'; - if(!is_file('.' . $qrcode_path)){ - $writer = new PngWriter(); - $code = CodeMode::create(base_url() . 'food/' . $data['applet_id'] . '/table-'. $data['shop_id'].'-'.$data['table_id'])->setSize(500); - $result = $writer->write($code); - $result->saveToFile('.' . $qrcode_path); - } - $qrcode['qrcode'] = $qrcode_path; +// $qrcode_path = '/temp/food/qrcode-table-' . $data['shop_id'] . '.png'; +// if(!is_file('.' . $qrcode_path)){ +// $writer = new PngWriter(); +// $code = CodeMode::create(base_url() . 'food/' . $data['applet_id'] . '/table-'. $data['shop_id'].'-'.$data['table_id'])->setSize(500); +// $result = $writer->write($code); +// $result->saveToFile('.' . $qrcode_path); +// } +// $qrcode['qrcode'] = $qrcode_path; return $qrcode; } diff --git a/app/store/view/food/shop/table/index.html b/app/store/view/food/shop/table/index.html index ee639a8..ca824ca 100644 --- a/app/store/view/food/shop/table/index.html +++ b/app/store/view/food/shop/table/index.html @@ -120,7 +120,7 @@ let list = ; $.showAction({ title: '餐桌码', - area: '990px', + area: '300px', content: template('tpl-qrcode', {qrcode:list[data.index].qrcode}), uCheck: true, btn: ['取消'], diff --git a/app/store/view/food/shop/table/qrcode.html b/app/store/view/food/shop/table/qrcode.html index e4ab129..c6dcafe 100644 --- a/app/store/view/food/shop/table/qrcode.html +++ b/app/store/view/food/shop/table/qrcode.html @@ -1,13 +1,6 @@ \ No newline at end of file diff --git a/public/temp/food/wechat-table-10001.png b/public/temp/food/wechat-table-10001.png index 08b33f1..97ecc19 100644 --- a/public/temp/food/wechat-table-10001.png +++ b/public/temp/food/wechat-table-10001.png @@ -1 +1 @@ -{"errcode":41001,"errmsg":"access_token missing rid: 655efa91-1df1ebb0-67ca51a1"} \ No newline at end of file +{"errcode":41001,"errmsg":"access_token missing rid: 656edda7-22ddb70b-7410cc76"} \ No newline at end of file diff --git a/runtime/cache/eb/300fe116b3568a7e80a6c2812b1a38.php b/runtime/cache/eb/300fe116b3568a7e80a6c2812b1a38.php index 36fe805..217a7e6 100644 --- a/runtime/cache/eb/300fe116b3568a7e80a6c2812b1a38.php +++ b/runtime/cache/eb/300fe116b3568a7e80a6c2812b1a38.php @@ -1,4 +1,4 @@ -1701756591 \ No newline at end of file +1701764602 \ No newline at end of file