XcxHomeSetting.php 652 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace app\api\model;
  3. use app\common\model\XcxHomeSetting as XcxHomeSettingModel;
  4. /**
  5. * 渠道销售统计模型
  6. * @package app\store\model
  7. */
  8. class XcxHomeSetting extends XcxHomeSettingModel
  9. {
  10. public function getSettingAttr($data){
  11. if ($data){
  12. return json_decode($data);
  13. }
  14. return null;
  15. }
  16. public function getPage(){
  17. $now = time();
  18. return $this->where(['open_status'=>1])
  19. ->where('start_time','<=',$now)
  20. ->where('end_time','>=',$now)
  21. ->field('id,home_type,setting,file_id,open_status')
  22. ->find();
  23. }
  24. }