Api.php 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670
  1. <?php
  2. namespace app\common\controller;
  3. use app\common\library\Auth;
  4. use think\Config;
  5. use think\exception\HttpResponseException;
  6. use think\exception\ValidateException;
  7. use think\Hook;
  8. use think\Lang;
  9. use think\Loader;
  10. use think\Request;
  11. use think\Response;
  12. use think\Route;
  13. use fast\Tree;
  14. use think\Db;
  15. use app\common\model\MoneyLog;
  16. /**
  17. * API控制器基类
  18. */
  19. class Api
  20. {
  21. /**
  22. * @var Request Request 实例
  23. */
  24. protected $request;
  25. /**
  26. * @var bool 验证失败是否抛出异常
  27. */
  28. protected $failException = false;
  29. /**
  30. * @var bool 是否批量验证
  31. */
  32. protected $batchValidate = false;
  33. /**
  34. * 快速搜索时执行查找的字段
  35. */
  36. protected $searchFields = 'id';
  37. /**
  38. * 是否是关联查询
  39. */
  40. protected $relationSearch = false;
  41. /**
  42. * 是否开启数据限制
  43. * 支持auth/personal
  44. * 表示按权限判断/仅限个人
  45. * 默认为禁用,若启用请务必保证表中存在admin_id字段
  46. */
  47. protected $dataLimit = false;
  48. /**
  49. * @var array 前置操作方法列表
  50. */
  51. protected $beforeActionList = [];
  52. /**
  53. * 无需登录的方法,同时也就不需要鉴权了
  54. * @var array
  55. */
  56. protected $noNeedLogin = [];
  57. /**
  58. * 无需鉴权的方法,但需要登录
  59. * @var array
  60. */
  61. protected $noNeedRight = [];
  62. /**
  63. * 权限Auth
  64. * @var Auth
  65. */
  66. protected $auth = null;
  67. /**
  68. * 默认响应输出类型,支持json/xml
  69. * @var string
  70. */
  71. protected $responseType = 'json';
  72. protected $pids=0;
  73. /**
  74. * 构造方法
  75. * @access public
  76. * @param Request $request Request 对象
  77. */
  78. public function __construct(Request $request = null)
  79. {
  80. $this->request = is_null($request) ? Request::instance() : $request;
  81. // 控制器初始化
  82. $this->_initialize();
  83. // 前置操作方法
  84. if ($this->beforeActionList) {
  85. foreach ($this->beforeActionList as $method => $options) {
  86. is_numeric($method) ?
  87. $this->beforeAction($options) :
  88. $this->beforeAction($method, $options);
  89. }
  90. }
  91. }
  92. /**
  93. * 初始化操作
  94. * @access protected
  95. */
  96. protected function _initialize()
  97. {
  98. header("Access-Control-Allow-Origin: *");
  99. $site=config('site');
  100. if(input('version')==$site['azbb']){//版本强制更新
  101. $this->success('version10001',$site['azxz']);
  102. }
  103. if (Config::get('url_domain_deploy')) {
  104. $domain = Route::rules('domain');
  105. if (isset($domain['api'])) {
  106. if (isset($_SERVER['HTTP_ORIGIN'])) {
  107. header("Access-Control-Allow-Origin: " . $this->request->server('HTTP_ORIGIN'));
  108. header('Access-Control-Allow-Credentials: true');
  109. header('Access-Control-Max-Age: 86400');
  110. }
  111. if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
  112. if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD'])) {
  113. header("Access-Control-Allow-Methods: GET, POST, OPTIONS");
  114. }
  115. if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS'])) {
  116. header("Access-Control-Allow-Headers: {$_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']}");
  117. }
  118. }
  119. }
  120. }
  121. //移除HTML标签
  122. $this->request->filter('trim,strip_tags,htmlspecialchars');
  123. $this->auth = Auth::instance();
  124. $modulename = $this->request->module();
  125. $controllername = strtolower($this->request->controller());
  126. $actionname = strtolower($this->request->action());
  127. // token
  128. $_gettoken=\think\Cookie::get('token');
  129. $gettoken=isset($_gettoken)?$_gettoken:$this->request->request("token");
  130. $token = $this->request->server('HTTP_TOKEN', $this->request->request('token',$_gettoken));
  131. $path = str_replace('.', '/', $controllername) . '/' . $actionname;
  132. // 设置当前请求的URI
  133. $this->auth->setRequestUri($path);
  134. // 检测是否需要验证登录
  135. if (!$this->auth->match($this->noNeedLogin)) {
  136. //初始化
  137. $this->auth->init($token);
  138. //检测是否登录
  139. // if (!$this->auth->isLogin()) {
  140. // $this->error(__('Please login first'), null, 401);
  141. // }
  142. // 判断是否需要验证权限
  143. if (!$this->auth->match($this->noNeedRight)) {
  144. // 判断控制器和方法判断是否有对应权限
  145. if (!$this->auth->check($path)) {
  146. $this->error(__('You have no permission'), null, 403);
  147. }
  148. }
  149. } else {
  150. // 如果有传递token才验证是否登录状态
  151. if ($token) {
  152. $this->auth->init($token);
  153. }
  154. }
  155. $upload = \app\common\model\Config::upload();
  156. // 上传信息配置后
  157. Hook::listen("upload_config_init", $upload);
  158. Config::set('upload', array_merge(Config::get('upload'), $upload));
  159. // 加载当前控制器语言包
  160. $this->loadlang($controllername);
  161. }
  162. /**
  163. * 加载语言文件
  164. * @param string $name
  165. */
  166. protected function loadlang($name)
  167. {
  168. $name = Loader::parseName($name);
  169. Lang::load(APP_PATH . $this->request->module() . '/lang/' . $this->request->langset() . '/' . str_replace('.', '/', $name) . '.php');
  170. }
  171. /**
  172. * 操作成功返回的数据
  173. * @param string $msg 提示信息
  174. * @param mixed $data 要返回的数据
  175. * @param int $code 错误码,默认为1
  176. * @param string $type 输出类型
  177. * @param array $header 发送的 Header 信息
  178. */
  179. protected function success($msg = '', $data = null, $code = 1, $type = null, array $header = [])
  180. {
  181. $this->result($msg, $data, $code, $type, $header);
  182. }
  183. /**
  184. * 操作失败返回的数据
  185. * @param string $msg 提示信息
  186. * @param mixed $data 要返回的数据
  187. * @param int $code 错误码,默认为0
  188. * @param string $type 输出类型
  189. * @param array $header 发送的 Header 信息
  190. */
  191. protected function error($msg = '', $data = null, $code = 0, $type = null, array $header = [])
  192. {
  193. $this->result($msg, $data, $code, $type, $header);
  194. }
  195. /**
  196. * 返回封装后的 API 数据到客户端
  197. * @access protected
  198. * @param mixed $msg 提示信息
  199. * @param mixed $data 要返回的数据
  200. * @param int $code 错误码,默认为0
  201. * @param string $type 输出类型,支持json/xml/jsonp
  202. * @param array $header 发送的 Header 信息
  203. * @return void
  204. * @throws HttpResponseException
  205. */
  206. protected function result($msg, $data = null, $code = 0, $type = null, array $header = [])
  207. {
  208. $result = [
  209. 'code' => $code,
  210. 'msg' => $msg,
  211. 'time' => Request::instance()->server('REQUEST_TIME'),
  212. 'data' => $data,
  213. ];
  214. // 如果未设置类型则自动判断
  215. $type = $type ? $type : ($this->request->param(config('var_jsonp_handler')) ? 'jsonp' : $this->responseType);
  216. if (isset($header['statuscode'])) {
  217. $code = $header['statuscode'];
  218. unset($header['statuscode']);
  219. } else {
  220. //未设置状态码,根据code值判断
  221. $code = $code >= 1000 || $code < 200 ? 200 : $code;
  222. }
  223. $response = Response::create($result, $type, $code)->header($header);
  224. throw new HttpResponseException($response);
  225. }
  226. /**
  227. * 前置操作
  228. * @access protected
  229. * @param string $method 前置操作方法名
  230. * @param array $options 调用参数 ['only'=>[...]] 或者 ['except'=>[...]]
  231. * @return void
  232. */
  233. protected function beforeAction($method, $options = [])
  234. {
  235. if (isset($options['only'])) {
  236. if (is_string($options['only'])) {
  237. $options['only'] = explode(',', $options['only']);
  238. }
  239. if (!in_array($this->request->action(), $options['only'])) {
  240. return;
  241. }
  242. } elseif (isset($options['except'])) {
  243. if (is_string($options['except'])) {
  244. $options['except'] = explode(',', $options['except']);
  245. }
  246. if (in_array($this->request->action(), $options['except'])) {
  247. return;
  248. }
  249. }
  250. call_user_func([$this, $method]);
  251. }
  252. /**
  253. * 设置验证失败后是否抛出异常
  254. * @access protected
  255. * @param bool $fail 是否抛出异常
  256. * @return $this
  257. */
  258. protected function validateFailException($fail = true)
  259. {
  260. $this->failException = $fail;
  261. return $this;
  262. }
  263. public function config(){
  264. $site=config('site');
  265. $tree = Tree::instance();
  266. $this->model = model('app\common\model\Category');
  267. $tree->init(collection($this->model->where(['type'=>'type','status'=>'normal'])->order('weigh desc,id desc')->select())->toArray(), 'pid');
  268. $fenlei = $tree->getTreeList($tree->getTreeArray(0), 'name');
  269. $config['site']=$site;
  270. $config['fenlei']=$fenlei;
  271. $das=$tree->init(collection($this->model->where(['type'=>'shopmenu','status'=>'normal','flag'=>['like','%menu%']])->order('weigh desc,id desc')->select())->toArray(), 'pid');
  272. $config['shopmenu']= $tree->getTreeArray(0);
  273. if($config['shopmenu']){
  274. foreach ($config['shopmenu'] as $k=>$v){
  275. if(strpos($v['image'],'http') !== false){
  276. $config['shopmenu'][$k]['image']=$v['image'];
  277. }else{
  278. $config['shopmenu'][$k]['image']=$site['imgurl'].$v['image'];
  279. }
  280. if(isset($v['url'])){
  281. if(strpos($v['url'],'http') !== false){
  282. $config['shopmenu'][$k]['url']='/pages/client/webva?url='.$v['url'];
  283. }else{
  284. $config['shopmenu'][$k]['url']=$v['url'];
  285. }
  286. }else{
  287. $config['shopmenu'][$k]['url']='';
  288. }
  289. }
  290. }
  291. if(is_array(config('site.banner'))){
  292. $banner=config('site.banner');
  293. $background=config('site.background');
  294. $link=config('site.link');
  295. foreach ($banner as $k=>$v){
  296. if(strpos($v,'http') !== false){
  297. $config['banner'][$k]['src']=$v;
  298. }else{
  299. $config['banner'][$k]['src']=$site['imgurl'].$v;
  300. }
  301. $config['banner'][$k]['background']=isset($background[$k])?$background[$k]:'#ffffff';
  302. if(isset($link[$k])){
  303. $url=isset($link[$k])?$link[$k]:'';
  304. if(strpos($link[$k],'http') !== false){
  305. $config['banner'][$k]['link']='/pages/client/webva?url='.$url;
  306. }else{
  307. $config['banner'][$k]['link']=$url;
  308. }
  309. }else{
  310. $config['banner'][$k]['link']='';
  311. }
  312. }
  313. }
  314. $beginToday=mktime(0,0,0,date('m'),date('d'),date('Y'));
  315. $endToday=mktime(0,0,0,date('m'),date('d')+1,date('Y'))-1;
  316. $times=[$beginToday,$endToday];
  317. $map['memo']='看广告赠送';
  318. $total = Db::name('user_money_log')
  319. ->whereTime('createtime', 'between', $times)
  320. ->where($map)
  321. ->count();
  322. $config['mrcsjr']=$total;
  323. $config['mrcs']=$site['mrcs'];
  324. $config['tels']=$site['tels'];
  325. $config['weixin']=$site['weixin'];
  326. $config['iskq']=$site['iskq'];
  327. $config['fxdj']=$site['fxdj'];
  328. $config['vipsj']=$site['vipsj'];
  329. $config['mbgColor']=$site['mbgColor'];
  330. $config['name']=$site['name'];
  331. return $config;
  332. }
  333. public function dailiyongjin($oid,$sid,$mid,$uid,$money,$tp){ //代理达人佣金结算
  334. $site=config('site');
  335. if($site['isdl']==1){
  336. Db::startTrans();
  337. try {
  338. $videolist=Db::name('videolist')->where('id',$sid)->find();
  339. $bid=isset($videolist['bid'])?$videolist['bid']:0;
  340. $this->dailiyj($oid,$sid,$mid,$bid,$money,$tp,1);
  341. Db::commit();
  342. }catch (Exception $e){
  343. Db::rollback();
  344. $this->error($e->getMessage());
  345. }
  346. }
  347. }
  348. public function dailiyj($oid,$sid,$mid,$bid,$money,$tp,$c){
  349. $site=config('site');
  350. if($bid>0 and $c<=2){
  351. $vadmin=Db::name('admin')->where('id',$bid)->find();
  352. $islx=isset($vadmin['islx'])?$vadmin['islx']:0;
  353. $bl=0;
  354. if($islx==1){
  355. $bl=$site['dlfy'];
  356. }
  357. if($islx==2){
  358. $bl=$site['drbl'];
  359. }
  360. $this->dailiyj($oid,$sid,$mid,$vadmin['pid'],$money,$tp,$c+1);
  361. $moneys=$money*$bl;
  362. if($moneys>=0.01){
  363. $before = $vadmin['money'];
  364. $after = $vadmin['money'] + $moneys;
  365. Db::name('admin') ->where('id',$bid)->setInc('money', $moneys);
  366. Db::name('admin_money_log')->insertGetId(['admin_id' =>$bid, 'money' => $moneys,'createtime' => time(), 'before' => $before, 'sid' => $sid,'mid' => $mid, 'oid' => $oid, 'after' => $after, 'memo' => $tp]);
  367. }
  368. }
  369. }
  370. public function yongjin($oid,$uid,$money,$tp){
  371. $site=config('site');
  372. if($site['iskq']==1 and $site['fxdj']){
  373. foreach ($site['fxdj'] as $k=>$v){
  374. $this->pids=0;
  375. $this->get_parent_id($uid,$k,1);
  376. //echo $k.'-'.$this->pids.',';
  377. if($this->pids>0){
  378. $this->yongjinjs($oid,$this->pids,$money*$v,$k,$tp);
  379. }
  380. }
  381. }
  382. }
  383. public function get_parent_id($pid,$cj,$sum){
  384. $User=model('User')->where(['id'=>$pid])->find();
  385. if($User){
  386. $this->pids = $User['pid'];
  387. if($sum<$cj){
  388. $this->get_parent_id($User['pid'],$cj,$sum+1);
  389. }
  390. }
  391. }
  392. public function yongjinjs($oid,$uid,$money,$cj,$tp='佣金结算'){
  393. $user = \app\common\model\User::getById($uid);
  394. $before = $user->money;
  395. $after = $user->money + $money;
  396. $user->save(['money' => $after]);
  397. //写入日志
  398. MoneyLog::create(['user_id' => $user['id'], 'money' => $money, 'before' => $before,'oid' => $oid, 'after' => $after, 'memo' => $cj.$tp]);
  399. }
  400. /**
  401. * 验证数据
  402. * @access protected
  403. * @param array $data 数据
  404. * @param string|array $validate 验证器名或者验证规则数组
  405. * @param array $message 提示信息
  406. * @param bool $batch 是否批量验证
  407. * @param mixed $callback 回调方法(闭包)
  408. * @return array|string|true
  409. * @throws ValidateException
  410. */
  411. protected function validate($data, $validate, $message = [], $batch = false, $callback = null)
  412. {
  413. if (is_array($validate)) {
  414. $v = Loader::validate();
  415. $v->rule($validate);
  416. } else {
  417. // 支持场景
  418. if (strpos($validate, '.')) {
  419. list($validate, $scene) = explode('.', $validate);
  420. }
  421. $v = Loader::validate($validate);
  422. !empty($scene) && $v->scene($scene);
  423. }
  424. // 批量验证
  425. if ($batch || $this->batchValidate) {
  426. $v->batch(true);
  427. }
  428. // 设置错误信息
  429. if (is_array($message)) {
  430. $v->message($message);
  431. }
  432. // 使用回调验证
  433. if ($callback && is_callable($callback)) {
  434. call_user_func_array($callback, [$v, &$data]);
  435. }
  436. if (!$v->check($data)) {
  437. if ($this->failException) {
  438. throw new ValidateException($v->getError());
  439. }
  440. return $v->getError();
  441. }
  442. return true;
  443. }
  444. /**
  445. * 生成查询所需要的条件,排序方式
  446. * @param mixed $searchfields 快速查询的字段
  447. * @param boolean $relationSearch 是否关联查询
  448. * @return array
  449. */
  450. protected function buildparams($searchfields = null, $relationSearch = null)
  451. {
  452. $searchfields = is_null($searchfields) ? $this->searchFields : $searchfields;
  453. $relationSearch = is_null($relationSearch) ? $this->relationSearch : $relationSearch;
  454. $search = $this->request->get("search", '');
  455. $filter = $this->request->get("filter", '');
  456. $op = $this->request->get("op", '', 'trim');
  457. $sort = $this->request->get("sort", !empty($this->model) && $this->model->getPk() ? $this->model->getPk() : 'id');
  458. $order = $this->request->get("order", "DESC");
  459. $offset = $this->request->get("offset", 0);
  460. $limit = $this->request->get("limit", 0);
  461. $filter = (array)json_decode($filter, true);
  462. $op = (array)json_decode($op, true);
  463. $filter = $filter ? $filter : [];
  464. $where = [];
  465. $tableName = '';
  466. if ($relationSearch) {
  467. if (!empty($this->model)) {
  468. $name = \think\Loader::parseName(basename(str_replace('\\', '/', get_class($this->model))));
  469. $name = $this->model->getTable();
  470. $tableName = $name . '.';
  471. }
  472. $sortArr = explode(',', $sort);
  473. foreach ($sortArr as $index => & $item) {
  474. $item = stripos($item, ".") === false ? $tableName . trim($item) : $item;
  475. }
  476. unset($item);
  477. $sort = implode(',', $sortArr);
  478. }
  479. $adminIds = $this->getDataLimitAdminIds();
  480. if (is_array($adminIds)) {
  481. $where[] = [$tableName . $this->dataLimitField, 'in', $adminIds];
  482. }
  483. if ($search) {
  484. $searcharr = is_array($searchfields) ? $searchfields : explode(',', $searchfields);
  485. foreach ($searcharr as $k => &$v) {
  486. $v = stripos($v, ".") === false ? $tableName . $v : $v;
  487. }
  488. unset($v);
  489. $where[] = [implode("|", $searcharr), "LIKE", "%{$search}%"];
  490. }
  491. foreach ($filter as $k => $v) {
  492. $sym = isset($op[$k]) ? $op[$k] : '=';
  493. if (stripos($k, ".") === false) {
  494. $k = $tableName . $k;
  495. }
  496. $v = !is_array($v) ? trim($v) : $v;
  497. $sym = strtoupper(isset($op[$k]) ? $op[$k] : $sym);
  498. switch ($sym) {
  499. case '=':
  500. case '<>':
  501. $where[] = [$k, $sym, (string)$v];
  502. break;
  503. case 'LIKE':
  504. case 'NOT LIKE':
  505. case 'LIKE %...%':
  506. case 'NOT LIKE %...%':
  507. $where[] = [$k, trim(str_replace('%...%', '', $sym)), "%{$v}%"];
  508. break;
  509. case '>':
  510. case '>=':
  511. case '<':
  512. case '<=':
  513. $where[] = [$k, $sym, intval($v)];
  514. break;
  515. case 'FINDIN':
  516. case 'FINDINSET':
  517. case 'FIND_IN_SET':
  518. $where[] = "FIND_IN_SET('{$v}', " . ($relationSearch ? $k : '`' . str_replace('.', '`.`', $k) . '`') . ")";
  519. break;
  520. case 'IN':
  521. case 'IN(...)':
  522. case 'NOT IN':
  523. case 'NOT IN(...)':
  524. $where[] = [$k, str_replace('(...)', '', $sym), is_array($v) ? $v : explode(',', $v)];
  525. break;
  526. case 'BETWEEN':
  527. case 'NOT BETWEEN':
  528. $arr = array_slice(explode(',', $v), 0, 2);
  529. if (stripos($v, ',') === false || !array_filter($arr)) {
  530. continue 2;
  531. }
  532. //当出现一边为空时改变操作符
  533. if ($arr[0] === '') {
  534. $sym = $sym == 'BETWEEN' ? '<=' : '>';
  535. $arr = $arr[1];
  536. } elseif ($arr[1] === '') {
  537. $sym = $sym == 'BETWEEN' ? '>=' : '<';
  538. $arr = $arr[0];
  539. }
  540. $where[] = [$k, $sym, $arr];
  541. break;
  542. case 'RANGE':
  543. case 'NOT RANGE':
  544. $v = str_replace(' - ', ',', $v);
  545. $arr = array_slice(explode(',', $v), 0, 2);
  546. if (stripos($v, ',') === false || !array_filter($arr)) {
  547. continue 2;
  548. }
  549. //当出现一边为空时改变操作符
  550. if ($arr[0] === '') {
  551. $sym = $sym == 'RANGE' ? '<=' : '>';
  552. $arr = $arr[1];
  553. } elseif ($arr[1] === '') {
  554. $sym = $sym == 'RANGE' ? '>=' : '<';
  555. $arr = $arr[0];
  556. }
  557. $where[] = [$k, str_replace('RANGE', 'BETWEEN', $sym) . ' time', $arr];
  558. break;
  559. case 'LIKE':
  560. case 'LIKE %...%':
  561. $where[] = [$k, 'LIKE', "%{$v}%"];
  562. break;
  563. case 'NULL':
  564. case 'IS NULL':
  565. case 'NOT NULL':
  566. case 'IS NOT NULL':
  567. $where[] = [$k, strtolower(str_replace('IS ', '', $sym))];
  568. break;
  569. default:
  570. break;
  571. }
  572. }
  573. $where = function ($query) use ($where) {
  574. foreach ($where as $k => $v) {
  575. if (is_array($v)) {
  576. call_user_func_array([$query, 'where'], $v);
  577. } else {
  578. $query->where($v);
  579. }
  580. }
  581. };
  582. return [$where, $sort, $order, $offset, $limit];
  583. }
  584. public function pissrc($str){
  585. if(!$str){
  586. return '';
  587. }
  588. $site=config('site');
  589. if(strpos($str,'http') !== false){
  590. $str=$str;
  591. }else{
  592. $str=$site['imgurl'].$str;
  593. }
  594. return $str;
  595. }
  596. /**
  597. * 获取数据限制的管理员ID
  598. * 禁用数据限制时返回的是null
  599. * @return mixed
  600. */
  601. protected function getDataLimitAdminIds()
  602. {
  603. if (!$this->dataLimit) {
  604. return null;
  605. }
  606. if ($this->auth->isSuperAdmin()) {
  607. return null;
  608. }
  609. $adminIds = [];
  610. if (in_array($this->dataLimit, ['auth', 'personal'])) {
  611. $adminIds = $this->dataLimit == 'auth' ? $this->auth->getChildrenAdminIds(true) : [$this->auth->id];
  612. }
  613. return $adminIds;
  614. }
  615. }