口腔客户管理系统
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

Target.php 996B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace app\admin\model;
  3. use think\Model;
  4. class Target extends Model
  5. {
  6. public function getAll($param, $page, $pageSize)
  7. {
  8. unset($param['page']);
  9. unset($param['pageSize']);
  10. foreach ($param as $k => $v) {
  11. if ($param[$k] === '' || $param[$k] === null) {
  12. unset($param[$k]);
  13. }
  14. }
  15. if (empty($pageSize)) {
  16. $result = $this->where($param)->select();
  17. return ['rows' => $result];
  18. } else {
  19. $result = $this->where($param)->limit($page, $pageSize)->select();
  20. $total = $this->where($param)->count();
  21. return ['rows' => $result, 'total' => $total];
  22. }
  23. }
  24. // public function read($param)
  25. // {
  26. // $result = $this->where($this->getPk(), $param[$this->getPk()])->find();
  27. // if (isset($result[$this->getPk()])) {
  28. // return $result->toArray();
  29. // } else {
  30. // return [];
  31. // }
  32. // }
  33. }