Integral.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. namespace app\user\controller;
  3. use library\Controller;
  4. use think\Db;
  5. /**
  6. * 积分记录
  7. * Class Integral
  8. * @package app\user\controller
  9. */
  10. class Integral extends Controller
  11. {
  12. protected $table ="UserIntegralLog";
  13. /**
  14. * 变更列表
  15. * @auth true
  16. * @menu true
  17. * @throws \think\Exception
  18. * @throws \think\db\exception\DataNotFoundException
  19. * @throws \think\db\exception\ModelNotFoundException
  20. * @throws \think\exception\DbException
  21. * @throws \think\exception\PDOException
  22. */
  23. public function index()
  24. {
  25. $this->title = '积分变更日志';
  26. $query = $this->_query($this->table);
  27. $where= [];
  28. if($this->request->request('user_name')) $where[]= ['m.name','like','%'.$this->request->request('user_name').'%'];
  29. if($this->request->request('sign_time')) $where[] = ['i.create_at','between time',[$this->request->request('sign_time').' 00:00:00',$this->request->request('sign_time').' 23:59:59']];
  30. $query->alias('i')
  31. ->field('i.* ,m.headimg,m.name,m.phone')
  32. ->join('store_member m',' m.id = i.user_id ','LEFT');
  33. if(!empty($where)) $query->where($where);
  34. $query ->order('i.id desc')->page();
  35. }
  36. /**
  37. * 删除
  38. * @auth true
  39. * @menu true
  40. * @throws \think\Exception
  41. * @throws \think\db\exception\DataNotFoundException
  42. * @throws \think\db\exception\ModelNotFoundException
  43. * @throws \think\exception\DbException
  44. * @throws \think\exception\PDOException
  45. */
  46. public function del()
  47. {
  48. $this->_save($this->table, ['is_deleted' => 1]);
  49. }
  50. }