| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <?php
- /**
- * 邀请有礼
- */
- namespace ghs\controllers;
- use bizHd\invite\services\InviteService;
- use common\components\stringUtil;
- use common\components\util;
- use Yii;
- class InviteController extends BaseController
- {
-
- //邀请有礼
- public function actionList()
- {
- $get = Yii::$app->request->get();
- $status = isset($get['status']) ? $get['status'] : -1;
- $search = isset($get['search']) ? $get['search'] : '';
- $where = [];
- $where['sjId'] = $this->sjId;
- if ($status != -1) {
- $where['status'] = $status;
- }
- if (!empty($search)) {
- if (stringUtil::isMobile($search)) {
- $where['introMobile'] = $search;
- } else {
- $where['introUserName'] = ['like', $search];
- }
- }
- $list = InviteService::getInviteList($where);
- util::success($list);
- }
-
- //邀请有礼明细
- public function actionDetail()
- {
- $id = Yii::$app->request->get('id');
- $invite = InviteService::getById($id);
- InviteService::valid($invite, $this->sjId);
- $detail = InviteService::getDetail($id);
- util::success($detail);
- }
-
- //确认发奖
- public function actionGive()
- {
- $id = Yii::$app->request->get('id');
- $invite = InviteService::getById($id);
- InviteService::valid($invite, $this->sjId);
- InviteService::give($invite);
- util::complete();
- }
- //奖励设置详情
- public function actionSet()
- {
-
- }
-
- //奖励设置更新
- public function actionSetUpdate()
- {
-
- }
-
- }
|