| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <?php
- /**
- * 重庆赤晓店信息科技有限公司
- * https://www.chixiaodian.com
- * Copyright (c) 2023 赤店商城 All rights reserved.
- */
- namespace app\modules\admin\models\order;
- use app\constants\OptionSetting;
- use app\models\Address;
- use app\models\District;
- use app\models\FoodFlag;
- use app\models\Goods;
- use app\models\Md;
- use app\models\Option;
- use app\models\Store;
- use app\utils\Notice\NoticeAction;
- use app\utils\OrderNo;
- use app\utils\Tools;
- use yii\helpers\Json;
- class MchOrderSubmitPreviewForm extends MchOrderForm
- {
- public function rules()
- {
- return parent::rules();
- }
- public function search()
- {
- if (!$this->validate())
- return [
- 'code' => 1,
- 'msg' => $this->getErrorSummary(false)[0],
- ];
- try {
- // 预生成订单号
- $order_no = OrderNo::getOrderNo(OrderNo::ORDER_MALL);
- cache()->set('delivery_order_no_' . $this->user->id, $order_no);
- $mchList = $this->getMchListData();
- if(isset($mchList['code']) && $mchList['code'] == 1){
- return $mchList;
- }
- } catch(\Exception $e) {
- return [
- 'code' => 1,
- 'line' => $e->getLine(),
- 'msg' => $e->getMessage(),
- 'file' => $e->getFile(),
- ];
- }
- return [
- 'code' => 0,
- 'msg' => 'OOKK',
- 'data' => [
- 'level' => $this->getLevelData(),
- 'mch_list' => $mchList,
- 'integral'=>$this->integral,
- 'user_integral' => $this->user->integral,
- 'user_money' => $this->user->money,
- 'address' => $this->getAddress(),
- 'address_id' => (string)(int)Address::findOne([
- 'user_id' => $this->saas_user->id,
- 'is_delete' => 0,
- 'is_default' => 1
- ])->id
- //'template_id' => $template_id,
- //'pay_type_list' => $this->getPayTypeList(),
- ],
- ];
- }
- }
|