Admin.php 460 B

1234567891011121314151617181920
  1. <?php
  2. /**
  3. * 后台账户表
  4. *
  5. */
  6. namespace app\common\model;
  7. use think\Cache;
  8. use think\Db;
  9. class Admin extends \think\Model
  10. {
  11. protected $pk = 'id';
  12. protected $table = 'cy_admin';
  13. public function getAllByCondition($field = 'id,username', $condition = [],$order='id desc')
  14. {
  15. $list = Db::table($this->table)->field($field)->where(['type'=> 1 ,'status'=> 1])->where($condition)->order($order)->select();
  16. return $list;
  17. }
  18. }