Garbage_adminAction.class.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. /**
  3. * 垃圾举报管理
  4. */
  5. require_once( ONU_ROOT . 'application/module/ctrl/Action.class.php');
  6. require_once ( ONU_ROOT . 'application/lib/data/adminAction.php');
  7. class Garbage_adminAction extends Action{
  8. public function __construct(){
  9. parent::__construct();
  10. if(empty($_SESSION['mds_user'])){
  11. header("Location:/?a=index&m=admin_login");
  12. exit();
  13. }
  14. }
  15. //垃圾举报管理的用户列表
  16. public function index(){
  17. $admin = new AdvertAdminAction();
  18. $api_user = $_SESSION['API_USER'];
  19. $api_key = $_SESSION['API_KEY'];
  20. $uid = $_SESSION['user_infos']['id'];
  21. $info = $_REQUEST['info'];
  22. $post_url = 'http://api.sendcloud.net/apiv2/spamreported/list';
  23. $e_date = date('Y-m-d',strtotime("+1 day"));
  24. $s_date = date("Y-m-d", strtotime("-30 day"));
  25. $date_show = trim($_REQUEST['date_show']);
  26. if($date_show){
  27. $date_array = explode("-",$_REQUEST['date_show']);
  28. $BeginDate2 = $date_array[0];
  29. $BeginDate2 = date('Y-m-d',strtotime($BeginDate2));
  30. $EndDate = $date_array[1];
  31. $EndDate = date('Y-m-d',strtotime($EndDate));
  32. }
  33. $start_date = $BeginDate2 ? $BeginDate2 : $s_date;
  34. $end_date = $EndDate ? $EndDate : $e_date;
  35. $B = date('Y/m/d',strtotime($start_date));
  36. $e = date('Y/m/d',strtotime($end_date));
  37. $date_show = $B.'-'.$e;
  38. $params = array(
  39. 'apiUser' => $api_user,
  40. 'apiKey' => $api_key,
  41. 'limit' => 100,//返回前100条数据
  42. 'startDate' => $start_date,
  43. 'endDate' => $end_date
  44. );
  45. $result = make_curl($post_url,$params);
  46. $list = $result['info']['dataList'];
  47. $this->assign('list',$list);
  48. $this->assign('date_show',$date_show);
  49. $this->assign('info',$info);
  50. $this->display("index.html");
  51. }
  52. // class end
  53. }
  54. ?>