AuthRuleModel.php 742 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace app\common\model;
  3. class AuthRuleModel extends BaseModel
  4. {
  5. protected $table = 'erp_auth_rule';
  6. protected function genSchema(array $schema)
  7. {
  8. // TODO: Implement genSchema() method.
  9. }
  10. /**
  11. * @param array $ids
  12. * @return array
  13. * @throws \think\db\exception\DataNotFoundException
  14. * @throws \think\db\exception\DbException
  15. * @throws \think\db\exception\ModelNotFoundException
  16. */
  17. public function findByIds($ids = []) {
  18. if(count($ids) == 0)
  19. return [];
  20. if($ids[0] == '*')
  21. return $this->select()->order("weigh","desc")->toArray();
  22. return $this->where('id','in', $ids)->order("weigh","desc")->select()->toArray();
  23. }
  24. }