Files
oil/server-tp6/app/store/controller/Account.php
T
2026-09-01 22:15:50 +08:00

38 lines
1009 B
PHP

<?php
declare (strict_types=1);
namespace app\store\controller;
use app\store\controller\Controller;
use app\store\model\Account as AccountModel;
use app\store\model\store\User;
/**
* 公司用户控制器
* Class Account
* @package app\store\controller
*/
class Account extends Controller
{
/**
* 公司列表
* @return mixed
* @throws \think\exception\DbException
*/
public function index()
{
$model = new AccountModel();
$getData = $this->request->param();
$user = $this->store['user'];
if($user['is_super'] == 0) {
$getData['store_user_id'] = User::getScope($user);
}
/*if(!empty($this->store['user']['company_id']) && $this->store['user']['is_super'] == 0){
$filter[] = ['company_id', 'in', json_decode($this->store['user']['company_id'],true)];
}*/
$list = $model->getList($getData);
return $this->renderSuccess(['list'=>$list,'user'=>$this->store['user']]);
}
}