| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- namespace biz\admin\classes;
- use biz\base\classes\BaseClass;
- use Yii;
- class AdminClass extends BaseClass
- {
- public static $baseFile = '\biz\admin\models\Admin';
- const STYLE_GHS = 2;
- const STYLE_HD = 1;
- const OPEN_SHOP_NO = 1;
- const OPEN_SHOP_CHECK = 2;
- const OPEN_SHOP_YES = 3;
- const SUPER_YES = 1;
- const SUPER_NO = 0;
- //lqh 2021.5.14 [id=>adminData]
- public static function getAdminMap($adminIds)
- {
- $where = [];
- $where['id'] = ['in', $adminIds];
- $data = self::getAllByCondition($where, null, "*");
- return array_column($data, null, "id");
- }
- //获取平台的超级管理员 ssh 20231005
- public static function getPtSuperAdminId()
- {
- //如果模拟成别人的账号,就取消超管的能力
- $simulateKey = 'simulate_admin_id';
- $simulateId = Yii::$app->redis->executeCommand('GET', [$simulateKey]);
- if (!empty($simulateId)) {
- $adminId = 0;
- } else {
- $adminId = 919;
- if (getenv('YII_ENV') == 'production') {
- $adminId = 4;
- }
- }
- return $adminId;
- }
- }
|