WechatDeliveryController.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. namespace app\modules\admin\controllers;
  3. use app\modules\admin\models\WechatDeliveryForm;
  4. class WechatDeliveryController extends BaseController
  5. {
  6. //创建同城配送门店
  7. public function actionCreateStore() {
  8. $form = new WechatDeliveryForm();
  9. $form->attributes = post_params();
  10. $form->store_id = get_store_id();
  11. $form->md_id = get_md_id();
  12. return $this->asJson($form->createStore());
  13. }
  14. //获取门店信息
  15. public function actionGetDeliveryStore() {
  16. $form = new WechatDeliveryForm();
  17. $form->attributes = get_params();
  18. $form->store_id = get_store_id();
  19. $form->md_id = get_md_id();
  20. return $this->asJson($form->getDeliveryStore());
  21. }
  22. //充值
  23. public function actionStoreCharge() {
  24. $form = new WechatDeliveryForm();
  25. $form->attributes = post_params();
  26. $form->store_id = get_store_id();
  27. $form->md_id = get_md_id();
  28. return $this->asJson($form->storeCharge());
  29. }
  30. //退款
  31. public function actionStoreRefund() {
  32. $form = new WechatDeliveryForm();
  33. $form->attributes = post_params();
  34. $form->store_id = get_store_id();
  35. $form->md_id = get_md_id();
  36. return $this->asJson($form->storeRefund());
  37. }
  38. //查询
  39. public function actionBalanceQuery() {
  40. $form = new WechatDeliveryForm();
  41. $form->attributes = post_params();
  42. $form->store_id = get_store_id();
  43. $form->md_id = get_md_id();
  44. return $this->asJson($form->balanceQuery());
  45. }
  46. //同步流水
  47. public function actionQueryFlow() {
  48. $form = new WechatDeliveryForm();
  49. $form->attributes = post_params();
  50. $form->flow_type = 1;
  51. $form->store_id = get_store_id();
  52. $form->md_id = get_md_id();
  53. return $this->asJson($form->queryFlow());
  54. }
  55. //获取流水
  56. public function actionGetBalanceLog() {
  57. $form = new WechatDeliveryForm();
  58. $form->attributes = get_params();
  59. $form->store_id = get_store_id();
  60. $form->md_id = get_md_id();
  61. return $this->asJson($form->getBalanceLog());
  62. }
  63. }