StoreOrderController.php 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528
  1. <?php
  2. namespace addons\Happiness\backend\controllers;
  3. use addons\Printer\common\models\Printer;
  4. use addons\Happiness\common\models\HappinessOrder;
  5. use addons\Happiness\common\models\HappinessOrderRefund;
  6. use addons\Happiness\common\models\HappinessStore;
  7. use common\enums\ExpressEnum;
  8. use common\enums\GoodsTypeEnum;
  9. use common\enums\MarketingTypeEnum;
  10. use common\enums\OrderStatusEnum;
  11. use common\enums\PayTypeEnum;
  12. use common\enums\RefundStatusEnum;
  13. use common\enums\RefundTypeEnum;
  14. use common\enums\ShippingTypeEnum;
  15. use common\enums\StatusEnum;
  16. use common\models\common\CapitalLog;
  17. use common\models\mall\MallAddons;
  18. use common\models\order\Order;
  19. use common\models\order\OrderDetail;
  20. use common\models\order\OrderAction;
  21. use common\models\order\OrderExpress;
  22. use common\models\order\OrderExpressLog;
  23. use Yii;
  24. use yii\helpers\Json;
  25. use common\models\elasticsearch\order\OrderAction as OrderActionEs;
  26. use common\models\order\OrderRefund;
  27. use common\models\user\UserLevel;
  28. class StoreOrderController extends BaseController
  29. {
  30. /**
  31. * @name:
  32. * @msg: 订单列表
  33. * @param {*}
  34. * @return {*}
  35. */
  36. public function actionIndex()
  37. {
  38. if (!\Yii::$app->request->isAjax) {
  39. return $this->render('/store-order/index');
  40. }
  41. if (\Yii::$app->request->isGet) {
  42. //商品列表筛选
  43. $get = \Yii::$app->request->get();
  44. $isReserve = $get['is_reserve'] ?? 0;
  45. if($isReserve){
  46. $order_status_list = OrderStatusEnum::getReserveMap();
  47. }else{
  48. $order_status_list = OrderStatusEnum::getMap();
  49. }
  50. $payment_type_list = PayTypeEnum::getMap();
  51. $shipping_type_list = ShippingTypeEnum::getMap();
  52. $rules = [
  53. [['order_status'], 'in', 'range' => array_keys($order_status_list)],
  54. [['payment_type'], 'in', 'range' => array_keys($payment_type_list)],
  55. [['shipping_type'], 'in', 'range' => array_keys($shipping_type_list)],
  56. [['start', 'end'], 'datetime', 'format' => 'php:Y-m-d H:i:s'],
  57. [['order_no', 'mobile', 'order_id'], 'safe'],
  58. [['type', 'type_value', 'store_name', 'store_user_id'], 'string'],
  59. [['is_reserve'],'in', 'range' => [0,1]],
  60. // ['mobile', 'match', 'pattern' => '/^1\d{10}$/', 'message' => '请输入正确的手机号码'],
  61. ];
  62. $res = \Yii::$app->services->validate->validate($get, $rules);
  63. if (!$res) return $this->error(\Yii::$app->services->validate->getErrorMessage());
  64. $where = HappinessOrder::searchParams($this->mall_id, $get);
  65. $alias = 'yo';
  66. $with = ['base_user', 'detail','reserve'];
  67. $order = "id desc";
  68. $join = [['LEFT JOIN', Order::tableName(). ' as o', "o.id = yo.order_id"]];
  69. $select = 'o.*,yo.store_id';
  70. $params = compact('where', 'with', 'order', 'alias', 'join', 'select');
  71. $page_data = HappinessOrder::listPage($params);
  72. if ($page_data === false) return $this->error(HappinessOrder::getStaticError());
  73. // dd(array_column($page_data['list'], 'order_status'));
  74. $compact_params = array_keys($page_data);
  75. $store_ids = array_column($page_data['list'],'store_id');
  76. $order_no_arr = array_column($page_data['list'],'order_no');
  77. $order_list = Order::lists(['where'=>[['order_no'=>$order_no_arr]],'index'=>'order_no','select'=>'id,order_no']);
  78. $store_list = HappinessStore::lists(['where'=>[['id'=>$store_ids]],'index'=>'id','select'=>'id,store_name,shop_owner,user_id']);
  79. extract($page_data);
  80. if(MallAddons::isInstall($this->mall_id,'Printer')){
  81. $printer_list = Printer::lists([
  82. 'where' => [
  83. ['mall_id'=> $this->mall_id],
  84. ['store_id'=>$store_ids],
  85. ['printer_type'=>2],
  86. ['status'=>StatusEnum::ENABLED]
  87. ],
  88. 'index'=>'store_id'
  89. ]);
  90. }
  91. foreach ($list as &$order) {
  92. $order['main_order_id'] = isset($order_list[$order['order_no']]['id'])?$order_list[$order['order_no']]['id']:0;
  93. $order_expresses = OrderExpress::getOrderExpresses([['order_id' => $order['id']]]);
  94. $order['store_name'] = $store_list[$order['store_id']]['store_name']??'';
  95. $order['shop_owner'] = $store_list[$order['store_id']]['shop_owner']??'';
  96. $order['store_user_id'] = $store_list[$order['store_id']]['user_id']??'';
  97. foreach ($order['detail'] as &$detail) {
  98. // 物流信息
  99. $detail['express'] = '';
  100. foreach ($order_expresses as $record) {
  101. $order_detail_ids = empty($record['order_detail_ids']) ? [] : json_decode($record['order_detail_ids'], true);
  102. if (is_string($order_detail_ids)) $order_detail_ids = [];
  103. if (in_array($detail['id'], $order_detail_ids)) {
  104. $detail['express'] = $record['express_name'] . ' | ' . $record['express_no'];
  105. if ($record['shipping_type'] == 0) $detail['express'] = '--';
  106. }
  107. }
  108. }
  109. $order['Printer']['is_show_printer'] = 0;
  110. if(isset($printer_list[$order['store_id']])){
  111. $order['Printer']['is_show_printer'] = 1;
  112. }
  113. }
  114. // $export_list = HappinessOrder::fieldsList();
  115. $marketing_type_map = MarketingTypeEnum::getMap();
  116. return $this->success('操作成功', compact($compact_params, 'order_status_list', 'payment_type_list', 'shipping_type_list', 'export_list', 'marketing_type_map'));
  117. }
  118. // if (\Yii::$app->request->post('flag') == 'EXPORT') {
  119. // $post = \Yii::$app->request->post();
  120. // $post['mall_id'] = $this->mall_id;
  121. // $filename = 'o2o门店订单列表-' . date('YmdHis') . '_' . rand(10000, 99999);
  122. // $res = CsvExportHelper::exportDownLoadCenter($this->mall_id, $filename, DownloadEnum::TYPE_ORDERS, StoreOrder::class, 'exportHandle', $post);
  123. // if ($res === false) return $this->error('加入导出任务失败' . CsvExportHelper::getStaticError());
  124. // return $this->success('添加导出任务成功,任务完成后请在下载中心进行下载!');
  125. // }
  126. }
  127. /**
  128. * @name:
  129. * @msg: 订单详情
  130. * @param {*}
  131. * @return {*}
  132. */
  133. public function actionDetail()
  134. {
  135. if (\Yii::$app->request->isAjax) {
  136. if (\Yii::$app->request->isGet) {
  137. //商品列表筛选
  138. $get = \Yii::$app->request->get();
  139. $order_status_list = OrderStatusEnum::getMap();
  140. $payment_type_list = PayTypeEnum::getMap();
  141. $shipping_type_list = ShippingTypeEnum::getMap();
  142. $rules = [[['id'], 'required']];
  143. $res = \Yii::$app->services->validate->validate($get, $rules);
  144. $where = [['mall_id' => $this->mall_id]];
  145. $where[] = ['=', 'id', $get['id']];
  146. // $where[] = ['>=', 'status', StatusEnum::DISABLED];
  147. $with = [
  148. 'base_user',
  149. 'detail',
  150. 'reserve'
  151. ];
  152. $params = compact('where', 'with');
  153. $order = Order::getOne($where, true, $with);
  154. if ($order === false) return $this->error(Order::getStaticError());
  155. $happiness_order = HappinessOrder::getOne([['order_id'=>$order['id']]], true, ['store']);
  156. if (!empty($happiness_order['store'])) $order['store'] = $happiness_order['store'];
  157. $express = OrderExpress::lists(['where'=>[['order_id'=>$order['id']]]]);
  158. $express_log = OrderExpressLog::lists(['where'=>[['order_id'=>$order['id']]]]);
  159. $order['express'] = $express;
  160. $order['express_log'] = $express_log;
  161. $express_log = [];
  162. if ($order['express_log']) {
  163. $time = time();
  164. $hour = \Yii::$app->services->setting->mall->get($this->mall_id, 'logistics.update');// 获取更新物流时间设置
  165. if (empty($hour) && is_array($hour)) $hour = 8;// 默认8小时更新一次
  166. foreach ($order['express_log'] as $item) {
  167. $item['status'] = ExpressEnum::getStatusMap($item['status']);
  168. // 检查物流是否已完成,未完成且距离上次修改时间超过一个小时
  169. if ($item['table_express_status'] == StatusEnum::DISABLED && $item['updated_at'] + $hour * 3600 < $time) {
  170. $item['list'] = OrderExpressLog::execExpressLog($this->mall_id, $item);
  171. }
  172. $express_log[$item['order_express_id']] = $item;
  173. }
  174. }
  175. if (!empty($order['express'])) {
  176. foreach ($order['express'] as &$key) {
  177. if (isset($express_log[$key['id']])) {
  178. $express_list = Json::decode($express_log[$key['id']]['list']);
  179. $key['now_state'] = $express_log[$key['id']]['status'];
  180. $key['express_log'] = is_null($express_list) ? '' : array_reverse($express_list['Traces']);
  181. }
  182. }
  183. }
  184. if (!empty($order['detail'])) {
  185. foreach ($order['detail'] as &$detail) {
  186. if (!empty($detail['attr_groups_format'])) {
  187. $attr_groups_format = json_decode($detail['attr_groups_format'], true);
  188. $attr_list = $attr_groups_format[$detail['sign_id']];
  189. $attr_group_name_list = array_column($attr_list, 'attr_group_name');
  190. $attr_name_list = array_column($attr_list, 'attr_name');
  191. $detail['attr_list'] = [];
  192. foreach ($attr_group_name_list as $index => $attr_group_name) {
  193. $detail['attr_list'][] = $attr_group_name . ':' . $attr_name_list[$index];
  194. }
  195. }
  196. }
  197. }
  198. $temp_step_arr = OrderStatusEnum::setpArrMap($order['order_status']); // 订单状态跟踪
  199. $step_arr = [];
  200. if(!empty($temp_step_arr)){
  201. foreach ($temp_step_arr as $k=>$v){
  202. if(!in_array($v['field'],['deposite_pay_time','final_payment_time'])){
  203. if($order['shipping_type'] == ShippingTypeEnum::PICKUP){
  204. if($v['field'] == 'consign_time'){
  205. $v['title'] = '买家自提';
  206. $v['field'] = 'sign_time';
  207. }
  208. } else if ($order['shipping_type'] == ShippingTypeEnum::MERCHANT_DISTRIBUTION) {
  209. if($v['field'] == 'consign_time'){
  210. $v['title'] = '门店配送';
  211. $v['field'] = 'sign_time';
  212. }
  213. }
  214. $step_arr[] = $v;
  215. }
  216. }
  217. }
  218. $order_action = OrderAction::getOrderAction([['order_id' => $order['id']??0]]);
  219. $marketing_type_map = MarketingTypeEnum::getMap();
  220. return $this->success('操作成功', compact('order', 'order_status_list', 'payment_type_list', 'shipping_type_list', 'step_arr', 'order_action', 'marketing_type_map'));
  221. }
  222. }
  223. return $this->render($this->action->id);
  224. }
  225. /**
  226. * @name:
  227. * @msg: 订单操作日志
  228. * @param {*}
  229. * @return {*}
  230. */
  231. public function actionOrderAction()
  232. {
  233. try {
  234. $request = \Yii::$app->request;
  235. if ($request->isAjax) {
  236. if ($request->isGet) {
  237. $params = \Yii::$app->request->get();
  238. $params['where'] = ['mall_id' => $this->mall_id];
  239. $params['is_page'] = true;
  240. $params['order'] = 'created_at desc';
  241. $list = OrderActionEs::getList($params);
  242. return $this->success('ok', $list);
  243. }
  244. }
  245. } catch (\Exception $e) {
  246. return $this->error($e->getMessage(), []);
  247. }
  248. return $this->render($this->action->id);
  249. }
  250. /**
  251. * @name:
  252. * @msg: 分润明细
  253. * @param {*}
  254. * @return {*}
  255. */
  256. public function actionCommissionAndScoreList()
  257. {
  258. $params = \Yii::$app->request->get();
  259. $wallet_type = 'commission';
  260. if (!empty($params['wallet_type'])) $wallet_type = $params['wallet_type'];
  261. $condition['where'] = [['order_id' => $params['order_id']]];
  262. $condition['select'] = 'id';
  263. $order_detail_list = OrderDetail::lists($condition);
  264. $order_detail_ids = array_column($order_detail_list, 'id');
  265. // $store_order = StoreOrder::findOne($params['order_id']);
  266. $order = Order::findOne(['id'=>$params['order_id']]);
  267. $mall_order_detail_ids = [];
  268. if($order){
  269. $condition['where'] = [['order_id' => $order['id']]];
  270. $condition['select'] = 'id';
  271. $mall_order_detail_list = OrderDetail::lists($condition);
  272. $mall_order_detail_ids = array_column($mall_order_detail_list, 'id');
  273. }
  274. $condition = [
  275. 'where' => [
  276. [
  277. 'or',
  278. [
  279. 'and',
  280. ['source_table' => 'store_order_detail'],
  281. ['source_table_id' => $order_detail_ids]
  282. ],
  283. [
  284. 'and',
  285. ['source_table' => [OrderDetail::tableName(),'order_detail']],
  286. ['source_table_id' => $mall_order_detail_ids]
  287. ],
  288. ]
  289. ],
  290. ];
  291. CapitalLog::$capitalType = "{$wallet_type}";
  292. $list = CapitalLog::getList($condition, 0);
  293. $level = UserLevel::find()->select("name,level")->where(['mall_id' => $this->mall_id, 'status' => StatusEnum::ENABLED])->asArray()->all();
  294. $level_data = array_column($level, 'name', 'level');
  295. CapitalLog::$capitalType = "{$wallet_type}_frozen";
  296. $condition['where'][] = ['status' => 0];
  297. $frozen_list = CapitalLog::getList($condition, 1);
  298. $list = array_merge($list, $frozen_list);
  299. return $this->success('操作成功', ['list' => $list, 'user_level' => $level_data]);
  300. }
  301. /**
  302. * @name:
  303. * @msg: 售后订单列表
  304. * @param {*}
  305. * @return {*}
  306. */
  307. public function actionRefundList()
  308. {
  309. if (!\Yii::$app->request->isAjax) {
  310. return $this->render('/store-order/refund', ['goods_type' => Json::encode(GoodsTypeEnum::getMap())]);
  311. }
  312. if (\Yii::$app->request->isGet) {
  313. //商品列表筛选
  314. $get = \Yii::$app->request->get();
  315. $refund_status_list = RefundStatusEnum::getMap();
  316. $refund_type_list = RefundTypeEnum::getMap();
  317. $rules = [
  318. [['is_feedback', 'goods_type'], 'integer'],
  319. [['keyword', 'order_no', 'type'], 'string'],
  320. [['type', 'order_no', 'keyword', 'refund_status'], 'safe'],
  321. ];
  322. $res = \Yii::$app->services->validate->validate($get, $rules);
  323. if ($res === false) return $this->error(\Yii::$app->services->validate->getErrorMessage());
  324. $where[] = ['o.mall_id' => $this->mall_id, 'status' => StatusEnum::ENABLED];
  325. $where[] = ['!=', 'yo.store_id', 0];
  326. if (!empty($get['goods_type'])) $where[] = ['o.goods_type' => $get['goods_type']];
  327. // 搜索查询
  328. !empty($get['order_no']) && $where[] = ['in', 'o.order_id', OrderRefund::getOidByOrderNo($this->mall_id, $get['order_no'])];
  329. if (isset($get['refund_status'])) {
  330. $get['refund_status'] = explode(',',$get['refund_status']);
  331. $where[] = ['in', 'o.refund_status', $get['refund_status']];
  332. //$where[] = ['=', 'refund_status', $get['refund_status']];
  333. } else {
  334. $where[] = ['in', 'o.refund_status', [RefundStatusEnum::APPLY, RefundStatusEnum::HANDEL, RefundStatusEnum::FINISH, RefundStatusEnum::RETURN_GOODS, RefundStatusEnum::EXCHANGE_GOODS, RefundStatusEnum::REFUSE]];
  335. }
  336. if (!empty($get['type']) && !empty($get['keyword'])) $where[] = HappinessOrderRefund::searchByKeyword($this->mall_id, $get['type'], $get['keyword']);
  337. $alias = 'yo';
  338. $with = ['base_user', 'orderDetail', 'order'];
  339. $join = [['LEFT JOIN', OrderRefund::tableName(). ' as o', "o.id = yo.refund_id"]];
  340. $select = 'o.*,yo.store_id';
  341. $order = "id desc";
  342. $params = compact('where', 'with', 'order', 'alias', 'join', 'select');
  343. $page_data = HappinessOrderRefund::listPage($params, false, true);
  344. if ($page_data === false) return $this->error(OrderRefund::getStaticError());
  345. $compact_params = array_keys($page_data);
  346. extract($page_data);
  347. $store_ids = array_column($list,'store_id');
  348. $store_list = HappinessStore::lists([
  349. 'where'=>[
  350. ['id'=>$store_ids],
  351. ['mall_id'=>$this->mall_id]
  352. ],
  353. 'index'=>'id',
  354. ]);
  355. foreach ($list as &$order) {
  356. foreach ($order['orderDetail'] as &$detail) {
  357. if (!empty($detail['attr_groups_format'])) {
  358. //规格
  359. $attr_groups_format = Json::decode($detail['attr_groups_format'], true);
  360. $attr_list = $attr_groups_format[$detail['sign_id']];
  361. $attr_group_name_list = array_column($attr_list, 'attr_group_name');
  362. $attr_name_list = array_column($attr_list, 'attr_name');
  363. $detail['attr_list'] = [];
  364. foreach ($attr_group_name_list as $index => $attr_group_name) {
  365. $detail['attr_list'][] = $attr_group_name . ':' . $attr_name_list[$index];
  366. }
  367. }
  368. }
  369. $order['store_name'] = '';
  370. $order['shop_mobile'] = '';
  371. if(isset($store_list[$order['store_id']])){
  372. $order['store_name'] = $store_list[$order['store_id']]['store_name'];
  373. $order['shop_mobile'] = $store_list[$order['store_id']]['shop_mobile'];
  374. }
  375. }
  376. return $this->success('操作成功', compact($compact_params, 'refund_status_list', 'refund_type_list'));
  377. }
  378. }
  379. /**
  380. * @name:
  381. * @msg: 售后订单详情
  382. * @param {*}
  383. * @return {*}
  384. */
  385. public function actionRefundDetail()
  386. {
  387. if (\Yii::$app->request->isAjax) {
  388. if (\Yii::$app->request->isGet) {
  389. //商品列表筛选
  390. $get = \Yii::$app->request->get();
  391. $order_status_list = OrderStatusEnum::getMap();
  392. $payment_type_list = PayTypeEnum::getMap();
  393. $feedback_type_list = OrderStatusEnum::getFeedbackMap();
  394. $address_list = \Yii::$app->services->setting->mall->get($this->mall_id, 'return_address.return_address');
  395. $address_list = $address_list ? json_decode($address_list, true) : [];
  396. $rules = [[['id'], 'required']];
  397. $res = \Yii::$app->services->validate->validate($get, $rules);
  398. if ($res === false) return $this->error(\Yii::$app->services->validate->getErrorMessage());
  399. $where = [['mall_id' => $this->mall_id]];
  400. $where[] = ['id' => $get['id']];
  401. $where[] = ['>=', 'status', StatusEnum::DISABLED];
  402. $with = ['base_user', 'order', 'orderDetail', 'marketing', 'step'];
  403. $params = compact('where', 'with');
  404. $refund = OrderRefund::getOne($where, true, $with);
  405. if ($refund === false) return $this->error(OrderRefund::getStaticError());
  406. foreach ($refund['orderDetail'] as $key => $detail) {
  407. if (!empty($detail['attr_groups_format'])) {
  408. $attr_groups_format = Json::decode($detail['attr_groups_format'], true);
  409. $attr_list = $attr_groups_format[$detail['sign_id']];
  410. $attr_group_name_list = array_column($attr_list, 'attr_group_name');
  411. $attr_name_list = array_column($attr_list, 'attr_name');
  412. $detail['attr_list'] = [];
  413. }
  414. }
  415. // 返还优惠内容
  416. if (!empty($refund['marketing'])) {
  417. $discount = [];
  418. $marketing = $refund['marketing'];
  419. if (!empty($marketing['deduct_score'])) {
  420. $score_name = \Yii::$app->services->setting->mall->get($this->mall_id, 'score.score_name');
  421. $discount[] = floatval($marketing['deduct_score']) . $score_name;
  422. }
  423. $refund['discount'] = implode('+', $discount);
  424. }
  425. $step_status = $refund['step'][0]['step_status'] ?? 0;
  426. $step_arr = RefundStatusEnum::stepNumArr(in_array($step_status, [RefundStatusEnum::STEP_NEGATIVE_1, RefundStatusEnum::STEP_NEGATIVE_2]) ? 1 : $refund['type']); // 进度条
  427. $step_text = RefundStatusEnum::getStepStatusText($step_status);
  428. return $this->success('操作成功', compact('refund', 'order_status_list', 'payment_type_list', 'feedback_type_list', 'step_arr', 'address_list', 'step_text'));
  429. }
  430. }
  431. return $this->render('/store-order/refund-detail');
  432. }
  433. /**
  434. * @name:
  435. * @msg: 售后处理
  436. * @param {*}
  437. * @return {*}
  438. */
  439. // |TODO:暂时先不做
  440. /* public function actionHandleRefund()
  441. {
  442. if (\Yii::$app->request->isAjax) {
  443. if (\Yii::$app->request->isPost) {
  444. //商品列表筛选
  445. $params = \Yii::$app->request->post();
  446. $rules = [
  447. [['id', 'step_status', 'store_id'], 'required'],
  448. [['id', 'step_status', 'mobile', 'address_type', 'store_id'], 'integer'],
  449. [['saler_express', 'saler_express_no', 'address', 'consignee'], 'string'],
  450. [['saler_express', 'saler_express_no', 'address_type', 'customer_name'], 'safe'],
  451. ];
  452. $res = \Yii::$app->services->validate->validate($params, $rules);
  453. if ($res === false) return $this->error(\Yii::$app->services->validate->getErrorMessage());
  454. // 退货地址
  455. $address = ['consignee' => $params['consignee'], 'mobile' => $params['mobile'], 'address' => $params['address']];
  456. // 换货物流信息
  457. $express = ['saler_express' => $params['saler_express'], 'saler_express_no' => $params['saler_express_no'], 'customer_name' => $params['customer_name']];
  458. $data = [
  459. 'id' => $params['id'],
  460. 'store_id' => $params['store_id'],
  461. 'step_status' => $params['step_status'],
  462. 'address' => $address,
  463. 'express' => $express,
  464. ];
  465. $logic = new OrderRefundLogic();
  466. $res = $logic->execute($this->mall_id, $data);
  467. if ($res == false) return $this->error($logic->getError());
  468. return $this->success('操作成功');
  469. }
  470. }
  471. } */
  472. public function actionReserve()
  473. {
  474. $is_show_username = Yii::$app->services->setting->mall->get($this->mall_id, 'order.is_show_username');
  475. return $this->render($this->action->id, ['is_show_username' => $is_show_username ?? 0]);
  476. }
  477. /**
  478. * 预约订单详情
  479. * @return string
  480. */
  481. public function actionReserveDetail()
  482. {
  483. return $this->render($this->action->id);
  484. }
  485. /**
  486. * 获取支付类型
  487. *
  488. * @return mixed
  489. */
  490. public function actionPaymentType()
  491. {
  492. return $this->success(
  493. 'ok',
  494. PayTypeEnum::getMap()
  495. );
  496. }
  497. }