| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <?php
- /**
- * 重庆赤晓店信息科技有限公司
- * https://www.chixiaodian.com
- * Copyright (c) 2023 赤店商城 All rights reserved.
- */
- namespace app\modules\client\controllers\v1;
- use app\modules\client\controllers\BaseController;
- use app\modules\admin\models\publicRanking\PublicRankingForm;
- use app\modules\admin\models\VideoShopGoodsForm;
- use app\modules\admin\models\VideoShopOrderForm;
- use app\models\PublicRankingTask;
- use app\models\Promoter;
- class PublicRankingController extends BaseController
- {
- public function actionSetting()
- {
- $store_id = get_store_id();
- return $this->asJson([
- 'code' => 0,
- 'data' => PublicRankingForm::conf($store_id),
- ]);
- }
- public function actionIndex()
- {
- $store_id = get_store_id();
- $user_id = get_user_id();
- $result = PublicRankingForm::publicRankingUserIndex($store_id, $user_id);
- return $this->asJson($result);
- }
- public function actionTask()
- {
- $store_id = get_store_id();
- $user_id = get_user_id();
- $result = PublicRankingForm::publicRankingUserIndexTask($store_id, $user_id, input_params('task_id'));
- return $this->asJson($result);
- }
- public function actionShopGoodsList() {
- $form = new VideoShopGoodsForm();
- $form->attributes = get_params();
- $form->store_id = get_store_id();
- $form->mini_id = PublicRankingForm::conf(get_store_id())['mini_id'];
- $form->status = -1;
- $res = $form->shopGoodsList(array_merge(['wx_status' => 5], all_params()));
- return $this->asJson($res);
- }
- public function actionTaskOrder()
- {
- $form = new VideoShopOrderForm();
- $form->attributes = get_params();
- $form->store_id = get_store_id();
- $form->mini_id = PublicRankingForm::conf(get_store_id())['mini_id'];
- $form->status = -2;
- $params = array_merge(all_params(), ['order_id' => PublicRankingTask::find()->where(['user_id' => get_user_id()])->select('order_id')]);
- $res = $form->getSharerOrderList($params);
- return $this->asJson($res);
- }
- public function actionPromAdd()
- {
- $store_id = get_store_id();
- $user_id = get_user_id();
- $result = PublicRankingForm::publicRankingUserIndexPromAdd($store_id, $user_id, input_params('promoter_id'), input_params('finder_id'), input_params('finder_name'));
- return $this->asJson($result);
- }
- public function actionOrder()
- {
- $form = new VideoShopOrderForm();
- $form->attributes = get_params();
- $form->store_id = get_store_id();
- $form->mini_id = PublicRankingForm::conf(get_store_id())['mini_id'];
- $params = array_merge(all_params(), ['promoter_id' => Promoter::find()->where(['store_id' => get_store_id(), 'user_id' => get_user_id()])->select('promoter_id')]);
- $res = $form->getSharerOrderList($params);
- return $this->asJson($res);
- }
- }
|