HelpApply.php 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace app\common\model;
  3. use liuniu\BaseModel;
  4. class HelpApply extends BaseModel
  5. {
  6. // 表名
  7. protected $name = 'help_apply';
  8. // 自动写入时间戳字段
  9. protected $autoWriteTimestamp = 'int';
  10. // 定义时间戳字段名
  11. protected $createTime = 'createtime';
  12. protected $updateTime = 'updatetime';
  13. protected $deleteTime = false;
  14. public static function lst($where)
  15. {
  16. $model = new self;
  17. if (isset($where['cid']) && $where['cid'] > 0) $model->where('cid', $where['cid']);
  18. if (isset($where['user_id']) && $where['user_id'] > 0) $model->where('user_id', $where['user_id']);
  19. if (isset($where['help_id']) && $where['help_id'] > 0) $model->where('help_id', $where['help_id']);
  20. if (isset($where['status']) && $where['status'] > -2) $model->where('status', $where['status']);
  21. $data = $model->order('id desc')->page($where['page'], $where['limit'])->select();
  22. foreach ($data as &$v)
  23. {
  24. $v['info'] = Help::info($v['cid'],$v['id'],$v['user_id']);
  25. }
  26. return $data;
  27. }
  28. }