OrderController.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539
  1. <?php
  2. namespace ghs\controllers;
  3. use biz\sj\services\MerchantExtendService;
  4. use bizGhs\express\services\DadaExpressServices;
  5. use bizHd\wx\classes\WxOpenClass;
  6. use bizGhs\admin\classes\AdminClass;
  7. use bizGhs\custom\classes\CustomClass;
  8. use bizGhs\merchant\services\ShopService;
  9. use bizGhs\order\classes\OrderClass;
  10. use bizGhs\order\services\OrderService;
  11. use bizHd\saas\services\RegionService;
  12. use bizGhs\product\classes\ProductClass;
  13. use common\components\dict;
  14. use common\components\dateUtil;
  15. use common\components\httpUtil;
  16. use common\services\xhPayToolService;
  17. use Yii;
  18. use common\components\util;
  19. use common\components\stringUtil;
  20. class OrderController extends BaseController
  21. {
  22. public $guestAccessAction = ['create-order', 'order-relate', 'fast-pay'];
  23. //订单列表 ssh 2021.1.20
  24. public function actionList()
  25. {
  26. $get = Yii::$app->request->get();
  27. $status = $get['status'] ?? 0;
  28. if (!empty($status)) {
  29. $where['status'] = $status;
  30. }
  31. $where['merchantId'] = $this->sjId;
  32. if (isset($get['shopId'])) {
  33. $shopId = $get['shopId'] ?? 0;
  34. if (!empty($shopId)) {
  35. $where['shopId'] = $this->shopId;
  36. }
  37. } else {
  38. $where['shopId'] = $this->shopId;
  39. }
  40. $searchTime = $get['searchTime'] ?? '';
  41. if (!empty($searchTime)) {
  42. $startTime = $get['startTime'] ?? '';
  43. $endTime = $get['endTime'] ?? '';
  44. $period = dateUtil::formatTime($searchTime, $startTime, $endTime);
  45. $where['addTime'] = ['between', [$period['startTime'], $period['endTime']]];
  46. }
  47. $name = $get['name'] ?? '';
  48. if (!empty($name)) {
  49. if (preg_match("/^[a-zA-Z\s]+$/", $name)) {
  50. $where['customNamePy'] = ['like', $name];
  51. } else {
  52. $where['customName'] = ['like', $name];
  53. }
  54. }
  55. $respond = OrderClass::getOrderList($where);
  56. $shop = $this->shop;
  57. $respond['allNum'] = $shop['totalOrder'] ?? 0;
  58. $respond['unPayNum'] = $shop['unPayOrder'] ?? 0;
  59. $respond['unSendNum'] = $shop['unSendOrder'] ?? 0;
  60. $respond['sendingNum'] = $shop['sendingOrder'] ?? 0;
  61. $respond['finishNum'] = $shop['finishOrder'] ?? 0;
  62. util::success($respond);
  63. }
  64. //商城下单操作 ssh 2021.1.14
  65. public function actionCreateOrder()
  66. {
  67. $post = Yii::$app->request->post();
  68. $shopId = $this->shopId;
  69. $customId = $post['customId'] ?? 0;
  70. $post['customId'] = $customId;
  71. if (!empty($customId)) {
  72. $custom = CustomClass::getCustom($customId);
  73. CustomClass::valid($custom, $this->sjId);
  74. $post['customMobile'] = $custom['mobile'] ?? '';
  75. $customName = $custom['name'] ?? '';
  76. $post['customName'] = $customName;
  77. $post['customNamePy'] = $custom['py'] ?? '';
  78. $post['customAvatar'] = $custom['shortSmallAvatar'] ?? '';
  79. }
  80. $post['shopAdminId'] = $this->shopAdminId;
  81. $shopAdmin = $this->shopAdmin;
  82. $post['shopAdminName'] = $shopAdmin['adminName'] ?? '';
  83. $post['shopId'] = $shopId;
  84. $post['payWay'] = $this->isWx == true ? 0 : 1;
  85. $post['merchantId'] = $this->sjId;
  86. $post['fromType'] = 1;
  87. $post['prePrice'] = 0.01;
  88. $post['actPrice'] = 0.01;
  89. $post['expressId'] = $post['expressId'] ?? 0;
  90. $post['clearType'] = $post['clearType'] ?? OrderClass::CLEAR_DEBT;
  91. $productJson = $post['product'] ?? '';
  92. if (empty($productJson)) {
  93. util::fail('请选择花材');
  94. }
  95. $productList = json_decode($productJson, true);
  96. if (empty($productList)) {
  97. util::fail('请选择花材');
  98. }
  99. $connection = Yii::$app->db;//事务处理
  100. $transaction = $connection->beginTransaction();
  101. try {
  102. //判断花材有效性
  103. ProductClass::valid($productList, $this->shopId);
  104. $post['product'] = $productList;
  105. $return = OrderClass::addOrder($post, $this->shop);
  106. $transaction->commit();
  107. util::success($return);
  108. } catch (\Exception $e) {
  109. $transaction->rollBack();
  110. Yii::info("下单失败原因:" . $e->getMessage());
  111. util::fail('下单失败');
  112. }
  113. }
  114. //延期支付 ssh 2021.1.19
  115. public function actionDebt()
  116. {
  117. $get = Yii::$app->request->get();
  118. $id = $get['id'] ?? 0;
  119. $info = OrderClass::getOrderInfo($id);
  120. OrderClass::valid($info, $this->shopId);
  121. OrderClass::debt($info, $this->shop);
  122. util::complete();
  123. }
  124. //获取商城下单要用的微信支付和小程序支付参数 ssh 2019.21.3
  125. public function actionWxPay()
  126. {
  127. ini_set('date.timezone', 'Asia/Shanghai');
  128. $post = Yii::$app->request->post();
  129. $couponId = $post['couponId'] ?? 0;
  130. $orderSn = isset($post['orderSn']) ? $post['orderSn'] : 0;
  131. $order = OrderClass::getByOrderSn($orderSn);
  132. if (empty($order)) {
  133. util::fail('订单号无效');
  134. }
  135. $id = $order['id'];
  136. //支付前验证订单有效性
  137. if (isset($order['adminId']) == false || $order['adminId'] != $this->adminId) {
  138. util::fail('没有权限操作');
  139. }
  140. $name = $order['orderName'] ?? '购买商品';
  141. $totalFee = $order['actPrice'];
  142. //强制使用小程序的miniOpenId
  143. $openId = $this->admin['miniOpenId'];
  144. $typeList = dict::getConfig('capitalType');
  145. $capitalType = $typeList['xhGhsOrder']['id'];
  146. //流水类型、优惠卷、微信支付(h5还是小程序支付)类型 带到回调
  147. $wxPayType = 0;
  148. if (httpUtil::isMiniProgram()) {
  149. $wxPayType = 1;
  150. }
  151. $attach = "couponId=" . $couponId . "&capitalType=" . $capitalType . '&wxPayType=' . $wxPayType;
  152. //订单30分钟后过期
  153. $now = time();
  154. $expireTime = $now + 1800;
  155. $wx = Yii::getAlias("@vendor/weixin");
  156. require_once($wx . '/lib/WxPay.Api.php');
  157. require_once($wx . '/example/WxPay.JsApiPay.php');
  158. $input = new \WxPayUnifiedOrder();
  159. $input->SetBody($name);
  160. $input->SetOut_trade_no($orderSn);
  161. $input->SetTotal_fee($totalFee * 100);
  162. $input->SetTime_start(date("YmdHis", $now));
  163. $input->SetAttach($attach);//将流水类型、代金劵等传给微信再回传
  164. $input->SetTime_expire(date("YmdHis", $expireTime));
  165. $input->SetNotify_url(Yii::$app->params['ghsHost'] . '/notice/wx-callback/');
  166. $input->SetTrade_type("JSAPI");
  167. //花卉宝代为申请的微信支付
  168. //$merchantExtend = $this->sjExtend;
  169. $merchantExtend = WxOpenClass::getGhsWxInfo();
  170. if (isset($merchantExtend['wxPayApply']) && $merchantExtend['wxPayApply'] == 1) {
  171. $input->SetSub_openid($openId);
  172. } else {
  173. $input->SetOpenid($openId);
  174. }
  175. //强制使用小程序的miniAppId
  176. $merchantExtend['wxAppId'] = $merchantExtend['miniAppId'];
  177. $wxOrder = \WxPayApi::unifiedOrder($input, 6, $merchantExtend);
  178. $tools = new \JsApiPay();
  179. $jsApiParameters = $tools->GetJsApiParameters($wxOrder, $merchantExtend);
  180. $newParams = json_decode($jsApiParameters, true);
  181. //微信不能修改价格
  182. $current = date("Y-m-d H:i:s");
  183. $updateData = ['deadline' => $current, 'modPrice' => 0];
  184. OrderClass::updateById($id, $updateData);
  185. util::success($newParams);
  186. }
  187. //获取订单详情 ssh 2021.1.21
  188. public function actionDetail()
  189. {
  190. $get = Yii::$app->request->get();
  191. $id = $get['id'] ?? 0;
  192. $info = OrderClass::getOrderInfo($id, true, true, true, false);
  193. OrderClass::valid($info, $this->shopId);
  194. util::success($info);
  195. }
  196. //自取和免发货流程处理 ssh 2021.1.22
  197. public function actionWithoutSend()
  198. {
  199. $get = Yii::$app->request->get();
  200. $id = $get['id'] ?? 0;
  201. $info = OrderClass::getOrderInfo($id);
  202. OrderClass::valid($info, $this->shopId);
  203. OrderClass::withoutSend($info);
  204. util::complete();
  205. }
  206. //本店送 ssh 2021.1.24
  207. public function actionSelfSend()
  208. {
  209. $get = Yii::$app->request->get();
  210. $id = isset($get['id']) ? $get['id'] : 0;
  211. $info = OrderClass::getOrderInfo($id);
  212. OrderClass::valid($info, $this->shopId);
  213. $connection = Yii::$app->db;
  214. $transaction = $connection->beginTransaction();
  215. try {
  216. OrderClass::selfSend($info);
  217. $transaction->commit();
  218. } catch (\Exception $exception) {
  219. $transaction->rollBack();
  220. Yii::info("本店送操作报错:" . $exception->getMessage());
  221. util::fail('操作失败');
  222. }
  223. util::complete();
  224. }
  225. //运费计算 ssh 2021.1.24
  226. public function actionFreight()
  227. {
  228. //2021.3.28 接入达达
  229. $get = Yii::$app->request->get();
  230. $orderId = $get['id'] ?? 0; //订单ID
  231. $customId = $get['customId'] ?? 0;
  232. if (!empty($customId)) {
  233. util::success(['sedCost' => 27]);
  234. }
  235. if(empty($orderId)){
  236. util::success(['sedCost' => 10]);
  237. }
  238. $province = $get['province'] ?? '';
  239. $city = $get['city'] ?? '';
  240. $address = $get['address'] ?? '';
  241. $floor = $get['floor'] ?? '';
  242. $fullAddress = $province . $city . $address . $floor;
  243. $sendTime = $get['sendTime'] ?? '';
  244. $lat = $get['lat'] ?? '';
  245. $lng = $get['long'] ?? '';
  246. if (empty($lat) || empty($lng) || empty($fullAddress)) {
  247. util::fail('请选择配送地址');
  248. }
  249. if (!empty($sendTime)) {
  250. //配送时间不为空
  251. // 预约发单时间(预约时间unix时间戳(10位),精确到分;整分钟为间隔,并且需要至少提前5分钟预约
  252. $sendTimeInt = strtotime($sendTime);
  253. $now = time();
  254. $diff = $sendTimeInt - $now;
  255. //因服务器写入时间,改为至少提前6分钟
  256. if ($diff <= 360) {
  257. util::fail('配送时间至少提前6分钟');
  258. }
  259. }
  260. //更新订单表
  261. $info = OrderClass::getOrderInfo($orderId);
  262. OrderClass::valid($info, $this->shopId);
  263. $expressAddInfo = [
  264. 'province' => $province,
  265. 'city' => $city,
  266. 'address' => $address,
  267. 'floor' => $floor,
  268. 'lat' => $lat,
  269. 'long' => $lng,
  270. 'sendTime' => date('Y-m-d H:i', strtotime($sendTime)),
  271. ];
  272. OrderClass::updateCustomExpressInfo($orderId, $expressAddInfo);
  273. //计算运费
  274. $info['province'] = $province;
  275. $info['city'] = $city;
  276. $info['address'] = $address;
  277. $info['floor'] = $floor;
  278. $info['fullAddress'] = $fullAddress;
  279. $info['lat'] = $lat;
  280. $info['long'] = $lng;
  281. $info['sendTime'] = $expressAddInfo['sendTime'];
  282. $res = DadaExpressServices::queryDeliverFee($info);
  283. util::success(['sedCost' => $res['fee']]);
  284. }
  285. //发快递和第三方配送 ssh 2021.1.24
  286. public function actionThirdSend()
  287. {
  288. $get = Yii::$app->request->get();
  289. $id = isset($get['id']) ? $get['id'] : 0;
  290. $info = OrderClass::getOrderInfo($id);
  291. OrderClass::valid($info, $this->shopId);
  292. $connection = Yii::$app->db;
  293. $transaction = $connection->beginTransaction();
  294. try {
  295. $respond = OrderClass::thirdSend($info, $get);
  296. $transaction->commit();
  297. util::success($respond);
  298. } catch (\Exception $exception) {
  299. $transaction->rollBack();
  300. Yii::info("发快递操作报错:" . $exception->getMessage());
  301. util::fail('操作失败' . $exception->getMessage());
  302. }
  303. }
  304. //确认送达 ssh 2021.1.24
  305. public function actionReach()
  306. {
  307. $get = Yii::$app->request->get();
  308. $id = isset($get['id']) ? $get['id'] : 0;
  309. $info = OrderClass::getOrderInfo($id);
  310. OrderClass::valid($info, $this->shopId);
  311. $connection = Yii::$app->db;
  312. $transaction = $connection->beginTransaction();
  313. try {
  314. OrderClass::reach($info);
  315. $transaction->commit();
  316. } catch (\Exception $exception) {
  317. $transaction->rollBack();
  318. Yii::info("送达操作报错:" . $exception->getMessage());
  319. util::fail('操作失败');
  320. }
  321. util::complete();
  322. }
  323. //快捷付款订单
  324. public function actionFastPay()
  325. {
  326. ini_set('date.timezone', 'Asia/Shanghai');
  327. $post = Yii::$app->request->post();
  328. $payWay = isset($post['payWay']) ? $post['payWay'] : 0;
  329. $post['shopId'] = 2;
  330. //默认门店订单
  331. $store = isset($post['store']) ? $post['store'] : 1;
  332. $post['store'] = $store;
  333. $fromType = $post['fromType'] ?? 1;
  334. $post['userId'] = $this->adminId;
  335. $admin = $this->admin;
  336. $post['bookName'] = isset($admin['adminName']) ? $admin['adminName'] : '';
  337. $bookMobile = isset($post['bookMobile']) && !empty($post['bookMobile']) && stringUtil::isMobile($post['bookMobile']) ? $post['bookMobile'] : '';
  338. $bookMobile = empty($bookMobile) && isset($admin['mobile']) && !empty($admin['mobile']) ? $admin['mobile'] : $bookMobile;
  339. $post['bookMobile'] = $bookMobile;
  340. $prePrice = round($post['prePrice'], 2);
  341. $couponId = isset($post['couponId']) ? $post['couponId'] : 0;
  342. $sourceType = 0;
  343. $discountData = OrderService::getDiscountPrice(['price' => $prePrice, 'sourceType' => $sourceType, 'couponId' => $couponId, 'userId' => $this->adminId]);
  344. $actPrice = $discountData['price'];
  345. $post['discountType'] = $discountData['discountType'];
  346. $post['discountAmount'] = $discountData['discountAmount'];
  347. $post['actPrice'] = $actPrice;
  348. $post['payStyle'] = 0;
  349. $post['merchantId'] = $this->sjId;
  350. $now = time();
  351. //订单5分钟后过期
  352. $expireTime = $now + 300;
  353. $post['createTime'] = date("Y-m-d H:i:s", $now);
  354. $post['deadline'] = $expireTime;
  355. if ($actPrice <= 0) {
  356. util::fail('请填写正确的金额');
  357. }
  358. //微信支付订单提交不能修改价格
  359. $post['modPrice'] = $this->isWx ? 0 : 1;
  360. $post['sourceType'] = $sourceType;
  361. $post['goodsNum'] = 1;
  362. $post['fromType'] = $fromType;
  363. $post['product'] = [];
  364. $order = OrderClass::addOrder($post);
  365. $id = $order['id'];
  366. $orderSn = $order['orderSn'];
  367. $merchantId = $this->sjId;
  368. if ($payWay == 0) {
  369. $id = $order['id'];
  370. $name = '购买商品';
  371. $totalFee = $actPrice;
  372. $admin = AdminClass::getAdminById($this->adminId);
  373. //小程序使用miniOpenId
  374. $openId = $admin['miniOpenId'];
  375. $typeList = dict::getConfig('capitalType');
  376. $capitalType = $typeList['xhGhsOrder']['id'];
  377. //流水类型、优惠卷、微信支付(h5还是小程序支付)类型 带到回调
  378. $wxPayType = 0;
  379. if (httpUtil::isMiniProgram()) {
  380. $wxPayType = 1;
  381. }
  382. $attach = 'capitalType=' . $capitalType . '&couponId=' . $couponId . '&wxPayType=' . $wxPayType;
  383. $wx = Yii::getAlias("@vendor/weixin");
  384. require_once($wx . '/lib/WxPay.Api.php');
  385. require_once($wx . '/example/WxPay.JsApiPay.php');
  386. $input = new \WxPayUnifiedOrder();
  387. $input->SetBody($name);
  388. $input->SetOut_trade_no($orderSn);
  389. $input->SetTotal_fee($totalFee * 100);
  390. $input->SetTime_start(date("YmdHis", $now));
  391. $input->SetAttach($attach);
  392. //设置订单有效期5分钟
  393. $input->SetTime_expire(date("YmdHis", $expireTime));
  394. $input->SetNotify_url(Yii::$app->params['ghsHost'] . '/notice/wx-callback/');
  395. $input->SetTrade_type("JSAPI");
  396. //花卉宝代为申请的微信支付
  397. //$merchantExtend = $this->sjExtend;
  398. $merchantExtend = WxOpenClass::getGhsWxInfo();
  399. if (isset($merchantExtend['wxPayApply']) && $merchantExtend['wxPayApply'] == 1) {
  400. $input->SetSub_openid($openId);
  401. } else {
  402. $input->SetOpenid($openId);
  403. }
  404. //小程序使用miniAppId
  405. if (httpUtil::isMiniProgram()) {
  406. $merchantExtend['wxAppId'] = $merchantExtend['miniAppId'];
  407. }
  408. //强制使用小程序的appId
  409. $merchantExtend['wxAppId'] = $merchantExtend['miniAppId'];
  410. Yii::info('支付发起使用小程序信息' . json_encode($merchantExtend));
  411. $wxOrder = \WxPayApi::unifiedOrder($input, 6, $merchantExtend);
  412. $tools = new \JsApiPay();
  413. $jsApiParameters = $tools->GetJsApiParameters($wxOrder, $merchantExtend);
  414. $newParams = json_decode($jsApiParameters, true);
  415. $newParams['orderId'] = $id;
  416. util::success($newParams);
  417. } elseif ($payWay == 1) {
  418. $extend = MerchantExtendService::getByMerchantId($merchantId);
  419. if (isset($extend['alipayInit']) == false || $extend['alipayInit'] == 0) {
  420. util::fail('支付宝付款即将开通...');
  421. }
  422. $config = [
  423. //应用ID,您的APPID。
  424. 'app_id' => $extend['alipayPId'],
  425. //商户私钥,您的原始格式RSA私钥
  426. 'merchant_private_key' => $extend['alipayKey'],
  427. //异步通知地址
  428. 'notify_url' => Yii::$app->params['ghsHost'] . "/notice/alipay-callback",
  429. //同步跳转
  430. 'return_url' => "",
  431. //编码格式
  432. 'charset' => "UTF-8",
  433. //签名方式
  434. 'sign_type' => "RSA2",
  435. //支付宝网关
  436. 'gatewayUrl' => "https://openapi.alipay.com/gateway.do",
  437. //支付宝公钥,查看地址:https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
  438. 'alipay_public_key' => $extend['alipayPublicKey'],
  439. ];
  440. Yii::info(json_encode($config) . ' aplipay config');
  441. $alipayWap = Yii::getAlias("@vendor/alipayWap");
  442. require_once($alipayWap . '/wappay/service/AlipayTradeService.php');
  443. require_once($alipayWap . '/wappay/buildermodel/AlipayTradeWapPayContentBuilder.php');
  444. $totalFee = $order['actPrice'];
  445. $out_trade_no = $orderSn;//商户订单号,商户网站订单系统中唯一订单号,必填
  446. $subject = '购买商品';//订单名称,必填
  447. $total_amount = $totalFee;//付款金额,必填
  448. $body = '';//商品描述,可空
  449. $timeout_express = "1m";//超时时间
  450. $typeList = dict::getConfig('capitalType');
  451. $capitalType = $typeList['xhGhsOrder']['id'];
  452. $passBackParams = 'capitalType=' . $capitalType . '&couponId=' . $couponId . '&merchantId=' . $merchantId;//将流水类型、优惠卷传过去
  453. $passBackParams = urlencode($passBackParams);
  454. $payRequestBuilder = new \AlipayTradeWapPayContentBuilder();
  455. $payRequestBuilder->setBody($body);
  456. $payRequestBuilder->setSubject($subject);
  457. $payRequestBuilder->setOutTradeNo($out_trade_no);
  458. $payRequestBuilder->setTotalAmount($total_amount);
  459. $payRequestBuilder->setTimeExpress($timeout_express);
  460. //在异步通知时将该参数原样返回
  461. $payRequestBuilder->setPassbackParams($passBackParams);
  462. //同步通知
  463. $returnUrl = Yii::$app->params['mallDomain'] . "/#/pages/callback/success?account={$merchantId}&shopId={$shopId}&orderSn={$orderSn}&totalPrice={$totalFee}&pageStatus=3&payDiscountPrice=0&payDiscountType=0";
  464. //异步通知
  465. $notifyUrl = Yii::$app->params['ghsHost'] . "/notice/alipay-callback";
  466. $payResponse = new \AlipayTradeService($config);
  467. $result = $payResponse->wapPay($payRequestBuilder, $returnUrl, $notifyUrl);
  468. //直接将支付宝的html返回给前端
  469. echo $result;
  470. } elseif ($payWay == 2) {
  471. $typeList = dict::getConfig('capitalType');
  472. $capitalType = $typeList['xhGhsOrder']['id'];
  473. $callbackParams = [];
  474. $respond = xhPayToolService::balancePay($callbackParams, $orderSn, $actPrice, $capitalType, $couponId);
  475. $balance = isset($respond['balance']) ? $respond['balance'] : 0;
  476. util::success(['discountAmount' => $discountData['discountAmount'], 'discountType' => $discountData['discountType'], 'orderSn' => $orderSn, 'orderId' => $id, 'balance' => $balance]);
  477. } else {
  478. util::fail('无效的支付方式');
  479. }
  480. }
  481. //下单要用到的相关信息 ssh 2019.12.6
  482. public function actionOrderRelate()
  483. {
  484. $regionTree = RegionService::tree();
  485. $shop = ShopService::getDefaultShop($this->sj);
  486. $freight = ['first' => 5, 'add' => 2];
  487. $mapKey = 'OFWBZ-2NTHP-EHNDD-LKWQY-GANM7-PXBJH';
  488. $out = ['freight' => $freight, 'shop' => $shop, 'region' => $regionTree, 'txMapKey' => $mapKey, 'merchant' => $this->sj];
  489. util::success($out);
  490. }
  491. //客户欠款的订单 ssh 2021.2.4
  492. public function actionDebtList()
  493. {
  494. $id = Yii::$app->request->get('id', 0);
  495. $info = CustomClass::getCustom($id);
  496. CustomClass::valid($info, $this->sjId);
  497. $where = ['customId' => $id, 'debt' => 1];
  498. $respond = OrderService::getDebtOrderList($where);
  499. $respond['customInfo'] = $info;
  500. util::success($respond);
  501. }
  502. }