OrderSubmitPreviewForm.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. /**
  3. * 重庆赤晓店信息科技有限公司
  4. * https://www.chixiaodian.com
  5. * Copyright (c) 2023 赤店商城 All rights reserved.
  6. */
  7. namespace app\plugins\scanCodePay\models\form;
  8. use app\utils\Notice\NoticeAction;
  9. class OrderSubmitPreviewForm extends OrderForm
  10. {
  11. public function rules()
  12. {
  13. return parent::rules();
  14. }
  15. public function search()
  16. {
  17. if (!$this->validate())
  18. return [
  19. 'code' => 1,
  20. 'msg' => $this->getErrorSummary(false)[0],
  21. ];
  22. try{
  23. $mchList = $this->getMchListData();
  24. if(isset($mchList['code']) && $mchList['code'] == 1){
  25. return $mchList;
  26. }
  27. }catch(\Exception $e){
  28. return [
  29. 'code'=>1,
  30. 'line' => $e->getLine(),
  31. 'file' => $e->getFile(),
  32. 'msg' => $e->getMessage()
  33. ];
  34. }
  35. return [
  36. 'code' => 0,
  37. 'msg' => 'OOKK',
  38. 'data' => [
  39. 'pay_type_list' => $this->getPayTypeList(),
  40. 'address' => $this->address,
  41. 'mch_list' => $mchList,
  42. 'integral'=>$this->integral,
  43. 'goods_card_list' => $this->goodsCardList(),
  44. 'template_id' => NoticeAction::getSendTamplateId(['order_pay', 'order_submit', 'order_send'])
  45. ],
  46. ];
  47. }
  48. }