sealaplModel.php 1011 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. class sealaplClassModel extends Model
  3. {
  4. public function getSealaplList($whereArr) {
  5. $where = "1=1";
  6. if (isset($whereArr['startDate']) && isset($whereArr['stopDate'])) {
  7. $startDate = $whereArr['startDate'];
  8. $stopDate = $whereArr['stopDate'];
  9. // $where .= " and IFNULL(`office_date`, `applydt`) >= '{$startDate}' and IFNULL(`office_date`, `applydt`) <= '{$stopDate}'";
  10. $where .= " and DATE_FORMAT(`office_date`,'%Y-%m-%d') >= '{$startDate}' and DATE_FORMAT(`office_date`,'%Y-%m-%d') <= '{$stopDate}'";
  11. }
  12. if (isset($whereArr['status']) && $whereArr['status'] == 1) {
  13. $where .= " and `status` = 1";
  14. }
  15. if (isset($whereArr['export_type']) && $whereArr['export_type'] != 0) {
  16. $where .= " and `seal_name` = '".$whereArr['export_type']."'";
  17. }
  18. $list = m("sealapl")
  19. ->getall($where, "*", "substr(applydt, 1, 4) desc, id asc");
  20. return $list;
  21. }
  22. }