DeliveryController.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php
  2. /**
  3. * 重庆赤晓店信息科技有限公司
  4. * https://www.chixiaodian.com
  5. * Copyright (c) 2023 赤店商城 All rights reserved.
  6. */
  7. namespace app\modules\admin\controllers\alipay;
  8. use app\modules\admin\controllers\BaseController;
  9. use app\modules\admin\models\AlipayThirdForm;
  10. use app\utils\Delivery\Alipay\ADelivery;
  11. use app\modules\admin\models\CouponForm;
  12. use \app\models\AlipayAcitvityVoucherOrder;
  13. class DeliveryController extends BaseController
  14. {
  15. public function actionConf() {
  16. $store_id = get_store_id();
  17. $mini_id = post_params("id")??get_params("id");
  18. try {
  19. $conf = ADelivery::getConf($store_id, $mini_id, 1, 1, 1);
  20. $res = [
  21. 'code'=>0,
  22. 'msg'=>'ok',
  23. 'data'=>$conf,
  24. ];
  25. } catch (\Exception $e) {
  26. return $this->asJson([
  27. 'code'=>1,
  28. 'msg'=>$e->getMessage(),
  29. ]);
  30. }
  31. return $this->asJson($res);
  32. }
  33. public function actionCompanyList() {
  34. $form = new AlipayThirdForm();
  35. $form->mini_id = post_params("id")??get_params("id");
  36. $res = $form->AlipayCommerceLogisticsLogisticscompanyInstantdeliveryQueryRequest();
  37. return $this->asJson($res);
  38. }
  39. public function actionCreateAccount() {
  40. $store_id = get_store_id();
  41. $mini_id = post_params("id")??get_params("id");
  42. $logistics_codes = post_params('logistics_codes');
  43. $res = ADelivery::createAccount($store_id, $mini_id, $logistics_codes);
  44. return $this->asJson($res);
  45. }
  46. public function actionQueryAccount() {
  47. $form = new AlipayThirdForm();
  48. $form->mini_id = post_params("id")??get_params("id");
  49. $res = $form->AlipayOpenInstantdeliveryAccountQueryRequest();
  50. return $this->asJson($res);
  51. }
  52. public function actionCreateMd() {
  53. $store_id = get_store_id();
  54. $mini_id = post_params("id")??get_params("id");
  55. $biz_content = post_params();
  56. $res = ADelivery::createMd($store_id, $mini_id, $biz_content);
  57. return $this->asJson($res);
  58. }
  59. public function actionQueryMd() {
  60. $store_id = get_store_id();
  61. $mini_id = post_params("id")??get_params("id");
  62. $res = ADelivery::getMd($store_id, $mini_id);
  63. return $this->asJson($res);
  64. }
  65. public function actionListMd() {
  66. $form = new AlipayThirdForm();
  67. $form->mini_id = post_params("id")??get_params("id");
  68. $page_no = post_params('page', 1);
  69. $res = $form->AlipayOpenInstantdeliveryMerchantshopQueryRequest($page_no);
  70. return $this->asJson($res);
  71. }
  72. }