StoreModel.php 720 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace app\common\model;
  3. class StoreModel extends BaseModel
  4. {
  5. protected $table = 'erp_store';
  6. protected function genSchema(array $schema)
  7. {
  8. // TODO: Implement genSchema() method.
  9. }
  10. public function findAllStore() {
  11. return $this->order('id','desc')->select();
  12. }
  13. public function doesItExist($abbr) {
  14. return $this->where([
  15. ["abbr", '=', $abbr],
  16. ["is_delete", '=', 0]
  17. ])->find();
  18. }
  19. public function findByPaginate(array $params) {
  20. $where = [
  21. ['is_delete', '=', 0]
  22. ];
  23. return $this->where($where)->order('create_time','desc')->paginate(['list_rows'=>10, "query" => $params]);
  24. }
  25. }