GoodsAgentController.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. namespace app\modules\alliance\controllers;
  3. use app\modules\alliance\models\GoodsAgentForm;
  4. use app\modules\alliance\behaviors\goodsAgentAuth;
  5. use yii\helpers\ArrayHelper;
  6. class GoodsAgentController extends BaseController
  7. {
  8. public function behaviors()
  9. {
  10. $merge = [
  11. [
  12. 'class' => goodsAgentAuth::class,
  13. ]
  14. ];
  15. return ArrayHelper::merge($merge, parent::behaviors());
  16. }
  17. //产品代理中心
  18. public function actionGetInfo() {
  19. $form = new GoodsAgentForm();
  20. $form->attributes = get_params();
  21. $res = $form->getInfo();
  22. return $this->asJson($res);
  23. }
  24. //产品代理(代理产品)
  25. public function actionApplyGoodsAgent() {
  26. $form = new GoodsAgentForm();
  27. $form->attributes = post_params();
  28. $res = $form->bindFrontAgentGoods();
  29. return $this->asJson($res);
  30. }
  31. //产品代理(查看已绑定代理产品)
  32. public function actionGetBindGoodsList() {
  33. $form = new GoodsAgentForm();
  34. $form->attributes = get_params();
  35. $res = $form->getBindGoodsList();
  36. return $this->asJson($res);
  37. }
  38. //产品代理(查看未绑定的代理产品)
  39. public function actionFrontAgentGoodsList() {
  40. $form = new GoodsAgentForm();
  41. $form->attributes = get_params();
  42. $res = $form->frontAgentGoodsList();
  43. return $this->asJson($res);
  44. }
  45. //产品代理(订单列表)
  46. public function actionGetOrderList() {
  47. $form = new GoodsAgentForm();
  48. $form->attributes = get_params();
  49. $res = $form->getInstallLog();
  50. return $this->asJson($res);
  51. }
  52. //点击配送
  53. public function actionSetInstallStatus() {
  54. $form = new GoodsAgentForm();
  55. $form->attributes = get_params();
  56. $order_type = get_params('order_type', 0);
  57. $res = $form->setInstallStatus($order_type);
  58. return $this->asJson($res);
  59. }
  60. }