1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
- namespace app\common\model\mysql;
- use think\Model;
- class AdminUser extends Model
- {
-
- public function getAdminUserByUsername($username)
- {
- if (empty($username)) {
- return false;
- }
- $where = [
- 'username' => trim($username),
- ];
- return $this->where($where)->find();
- }
-
- public function updateById($id, $data)
- {
- $id = (int)$id;
- if (empty($id) || empty($data) || !is_array($data)) {
- return false;
- }
- $where = [
- 'id' => $id,
- ];
- return $this->where($where)->save($data);
- }
- }
|