StoreClerkController.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <?php
  2. namespace app\modules\alliance\controllers;
  3. use app\modules\alliance\behaviors\StoreClerk;
  4. use app\modules\alliance\models\StoreClerkForm;
  5. use yii\helpers\ArrayHelper;
  6. class StoreClerkController extends BaseController
  7. {
  8. public $store_id = 0;
  9. public $store_clerk_id = 0;
  10. /**
  11. * @return array
  12. */
  13. public function behaviors()
  14. {
  15. return ArrayHelper::merge(parent::behaviors(), [
  16. [
  17. 'class' => StoreClerk::class
  18. ]
  19. ]);
  20. }
  21. //门店中心
  22. public function actionStaffCenter() {
  23. $form = new StoreClerkForm();
  24. $form->store_id = $this->store_id;
  25. $form->store_clerk_id = $this->store_clerk_id;
  26. return $this->asJson($form->staffCenter());
  27. }
  28. //订单列表
  29. public function actionOfflineOrder() {
  30. $form = new StoreClerkForm();
  31. $form->attributes = get_params();
  32. $form->store_id = $this->store_id;
  33. $form->store_clerk_id = $this->store_clerk_id;
  34. return $this->asJson($form->offlineOrder());
  35. }
  36. //订单详情
  37. public function actionOrderDetail() {
  38. $form = new StoreClerkForm();
  39. $form->attributes = all_params();
  40. $form->store_id = $this->store_id;
  41. $form->store_clerk_id = $this->store_clerk_id;
  42. return $this->asJson($form->orderDetail());
  43. }
  44. //订单发货
  45. public function actionSendOrder() {
  46. $form = new StoreClerkForm();
  47. $form->attributes = all_params();
  48. $form->store_id = $this->store_id;
  49. $form->store_clerk_id = $this->store_clerk_id;
  50. return $this->asJson($form->sendOrder());
  51. }
  52. //订单核销
  53. public function actionClerkOrder() {
  54. $form = new StoreClerkForm();
  55. $form->attributes = all_params();
  56. $form->store_id = $this->store_id;
  57. $form->store_clerk_id = $this->store_clerk_id;
  58. return $this->asJson($form->clerkOrder());
  59. }
  60. //订单核销详情
  61. public function actionClerk() {
  62. $form = new StoreClerkForm();
  63. $form->attributes = get_params();
  64. $form->store_id = $this->store_id;
  65. $form->store_clerk_id = $this->store_clerk_id;
  66. return $this->asJson($form->clerkInfo());
  67. }
  68. //到货通知
  69. public function actionNotice() {
  70. $form = new StoreClerkForm();
  71. $form->attributes = all_params();
  72. $form->store_id = $this->store_id;
  73. $form->store_clerk_id = $this->store_clerk_id;
  74. $form->order_id = post_params('order_ids');
  75. return $this->asJson($form->notice());
  76. }
  77. public function actionSetOrderWords() {
  78. $form = new StoreClerkForm();
  79. $form->attributes = all_params();
  80. $form->store_id = $this->store_id;
  81. $form->store_clerk_id = $this->store_clerk_id;
  82. return $this->asJson($form->setOrderWords());
  83. }
  84. public function actionOrderCancel() {
  85. $form = new StoreClerkForm();
  86. $form->attributes = all_params();
  87. $form->store_id = $this->store_id;
  88. $form->store_clerk_id = $this->store_clerk_id;
  89. return $this->asJson($form->orderCancel());
  90. }
  91. public function actionApplyOrderDelete() {
  92. $form = new StoreClerkForm();
  93. $form->attributes = all_params();
  94. $form->store_id = $this->store_id;
  95. $form->store_clerk_id = $this->store_clerk_id;
  96. return $this->asJson($form->applyOrderDelete());
  97. }
  98. public function actionHandleRefund() {
  99. $form = new StoreClerkForm();
  100. $form->attributes = all_params();
  101. $form->store_id = $this->store_id;
  102. $form->store_clerk_id = $this->store_clerk_id;
  103. return $this->asJson($form->handleRefund());
  104. }
  105. /**
  106. * 订单确认收货
  107. */
  108. public function actionConfirm()
  109. {
  110. $form = new StoreClerkForm();
  111. $form->attributes = all_params();
  112. $form->store_id = $this->store_id;
  113. $form->store_clerk_id = $this->store_clerk_id;
  114. return $this->asJson($form->confirm());
  115. }
  116. }