|
@@ -28,8 +28,7 @@ class AdminUserController extends AdminBaseController
|
|
|
public function auth()
|
|
|
{
|
|
|
$keyword = $this->request->param('keyword');
|
|
|
- $list = UserAuthModel::
|
|
|
- where(function ($query) use ($keyword) {
|
|
|
+ $list = UserAuthModel::where(function ($query) use ($keyword) {
|
|
|
if (!empty($keyword)) {
|
|
|
$query->where('name|idcard|mobile', 'like', "%$keyword%");
|
|
|
}
|
|
@@ -39,6 +38,14 @@ class AdminUserController extends AdminBaseController
|
|
|
'query' => Request::param(),//不丢失已存在的url参数
|
|
|
]);
|
|
|
|
|
|
+ $count = UserAuthModel::where(function ($query) use ($keyword) {
|
|
|
+ if (!empty($keyword)) {
|
|
|
+ $query->where('name|idcard|mobile', 'like', "%$keyword%");
|
|
|
+ }
|
|
|
+ })
|
|
|
+ ->count();
|
|
|
+ $this->assign('total', $count);
|
|
|
+
|
|
|
$this->assign('keyword', $keyword ?: '');
|
|
|
|
|
|
// 获取分页显示
|
|
@@ -54,8 +61,8 @@ class AdminUserController extends AdminBaseController
|
|
|
*/
|
|
|
public function authAdd()
|
|
|
{
|
|
|
- $this->assign('idtype',Constant::ID_TYPE);
|
|
|
- $this->assign('marry',Constant::MARRY);
|
|
|
+ $this->assign('idtype', Constant::ID_TYPE);
|
|
|
+ $this->assign('marry', Constant::MARRY);
|
|
|
return $this->fetch();
|
|
|
}
|
|
|
|
|
@@ -103,8 +110,8 @@ class AdminUserController extends AdminBaseController
|
|
|
}
|
|
|
$this->assign('auth', $auth);
|
|
|
|
|
|
- $this->assign('idtype',Constant::ID_TYPE);
|
|
|
- $this->assign('marry',Constant::MARRY);
|
|
|
+ $this->assign('idtype', Constant::ID_TYPE);
|
|
|
+ $this->assign('marry', Constant::MARRY);
|
|
|
|
|
|
return $this->fetch();
|
|
|
}
|
|
@@ -164,7 +171,7 @@ class AdminUserController extends AdminBaseController
|
|
|
$file = WEB_ROOT . trim($url, '/');
|
|
|
if (file_exists($file)) {
|
|
|
$excel = new Excel();
|
|
|
- $data = $excel->import($file, ['no', 'name', 'company', 'idcard', 'marry', 'mobile', 'id_type','marry'], 1);
|
|
|
+ $data = $excel->import($file, ['no', 'name', 'company', 'idcard', 'marry', 'mobile', 'id_type', 'marry'], 1);
|
|
|
$idtype = Constant::ID_TYPE;
|
|
|
$marry = Constant::MARRY;
|
|
|
foreach ($data as $k => $v) {
|