OrderController.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. /**
  3. * 重庆赤晓店信息科技有限公司
  4. * https://www.chixiaodian.com
  5. * Copyright (c) 2023 赤店商城 All rights reserved.
  6. */
  7. namespace app\plugins\scanCodePay\controllers;
  8. use app\models\Order;
  9. use app\plugins\scanCodePay\models\form\OrderListForm;
  10. use app\plugins\scanCodePay\models\form\ScanCodePaySendIntegralForm;
  11. use yii\base\BaseObject;
  12. use app\utils\ShareQrcode;
  13. class OrderController
  14. {
  15. /**
  16. * 平台商品订单列表
  17. */
  18. public function actionList() {
  19. $store_id = get_store_id();
  20. $form = new OrderListForm();
  21. $form->attributes = get_params();
  22. $form->store_id = $store_id;
  23. $form->order_id = get_params('order_id');
  24. $form->is_offline = 1;
  25. $form->md_id = get_md_id();
  26. return $form->search();
  27. }
  28. public function actionSendIntegral() {
  29. $form = new ScanCodePaySendIntegralForm();
  30. $form->attributes = get_params();
  31. $form->store_id = get_store_id();
  32. $form->mch = 0;
  33. return $form->save();
  34. }
  35. /**
  36. * 商盟二维码
  37. */
  38. public function actionFoodQr()
  39. {
  40. $scene = '';
  41. $store_id = get_store_id();
  42. $scene = $scene ?: "store:{$store_id}";
  43. //需要小程序页面存在 不然会报错
  44. $res = ShareQrcode::wxQrcode('pages/shop/shopDetail', $scene);
  45. //$res = ShareQrcode::wxQrcode('pages/home/home', $scene);
  46. $wx_url_path = $res['url_path'];
  47. return [
  48. 'code'=>0,
  49. 'msg'=>"成功",
  50. 'data'=>[
  51. $wx_url_path
  52. ]
  53. ];
  54. }
  55. }