InviteController.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. /**
  3. * 邀请有礼
  4. */
  5. namespace ghs\controllers;
  6. use bizHd\invite\services\InviteService;
  7. use common\components\stringUtil;
  8. use common\components\util;
  9. use Yii;
  10. class InviteController extends BaseController
  11. {
  12. //邀请有礼
  13. public function actionList()
  14. {
  15. $get = Yii::$app->request->get();
  16. $status = isset($get['status']) ? $get['status'] : -1;
  17. $search = isset($get['search']) ? $get['search'] : '';
  18. $where = [];
  19. $where['sjId'] = $this->sjId;
  20. if ($status != -1) {
  21. $where['status'] = $status;
  22. }
  23. if (!empty($search)) {
  24. if (stringUtil::isMobile($search)) {
  25. $where['introMobile'] = $search;
  26. } else {
  27. $where['introUserName'] = ['like', $search];
  28. }
  29. }
  30. $list = InviteService::getInviteList($where);
  31. util::success($list);
  32. }
  33. //邀请有礼明细
  34. public function actionDetail()
  35. {
  36. $id = Yii::$app->request->get('id');
  37. $invite = InviteService::getById($id);
  38. InviteService::valid($invite, $this->sjId);
  39. $detail = InviteService::getDetail($id);
  40. util::success($detail);
  41. }
  42. //确认发奖
  43. public function actionGive()
  44. {
  45. $id = Yii::$app->request->get('id');
  46. $invite = InviteService::getById($id);
  47. InviteService::valid($invite, $this->sjId);
  48. InviteService::give($invite);
  49. util::complete();
  50. }
  51. //奖励设置详情
  52. public function actionSet()
  53. {
  54. }
  55. //奖励设置更新
  56. public function actionSetUpdate()
  57. {
  58. }
  59. }