12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php namespace App\Models;
- /**
- * @author Andy Brookes
- * @author Andy Brookes <andybrookestar at gmail dot com>
- */
- use CodeIgniter\Database\ConnectionInterface;
- use CodeIgniter\Model;
- class UserModel extends Model
- {
- protected $limit;
- protected $offset;
- protected $table = 'admin';
- protected $primaryKey = 'Id';
- protected $allowedFields = ['Name','Password','Role'];
- public function getUser()
- {
- $this->limit=1;
- return $this->findAll($this->limit);
-
- }
- public function getOne($role)
- {
- return $this->asArray()
- ->where(['Role' => $role])
- ->first();
- }
- }
|