WeiboOrderAction.class.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Fanwe 方维直播系统
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2011 http://www.fanwe.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Author: 云淡风轻(1956838968@qq.com)
  8. // +----------------------------------------------------------------------
  9. class WeiboOrderAction extends CommonAction{
  10. public function index()
  11. {
  12. $weibo = $this->get_order_list();
  13. $this->assign ( 'list', $weibo );
  14. $this->display ();
  15. }
  16. public function weixin(){
  17. $weibo = $this->get_order_list('weixin');
  18. $this->assign ( 'list', $weibo );
  19. $this->display ();
  20. }
  21. public function photo(){
  22. $weibo = $this->get_order_list('photo');
  23. $this->assign ( 'list', $weibo );
  24. $this->display ();
  25. }
  26. public function red_photo(){
  27. $weibo = $this->get_order_list('red_photo');
  28. $this->assign ( 'list', $weibo );
  29. $this->display ();
  30. }
  31. public function goods(){
  32. $weibo = $this->get_order_list('goods');
  33. $this->assign ( 'list', $weibo );
  34. $this->display ();
  35. }
  36. public function reward(){
  37. $weibo = $this->get_order_list('reward');
  38. $this->assign ( 'list', $weibo );
  39. $this->display ();
  40. }
  41. public function chat(){
  42. $weibo = $this->get_order_list('chat');
  43. $this->assign ( 'list', $weibo );
  44. $this->display ();
  45. }
  46. public function get_order_list($type=''){
  47. $now=get_gmtime();
  48. $condition = 'type = 11 ';
  49. if(intval($_REQUEST['weibo_id'])>0)
  50. {
  51. $condition = " and id =". intval($_REQUEST['weibo_id']);
  52. }
  53. if(!$type){
  54. $type = $_REQUEST['type'];
  55. }
  56. if(trim($type))
  57. {
  58. $condition .= " and type_cate ='". trim($type)."' ";
  59. }
  60. if($_REQUEST['sattus']!==''&&$_REQUEST['sattus']!=''){
  61. $condition = " status =". intval($_REQUEST['sattus']);
  62. }
  63. $create_time_1=empty($_REQUEST['create_time_1'])?to_date($now,'Y-m-d'):strim($_REQUEST['create_time_1']);
  64. $create_time_1=to_timespan($create_time_1);
  65. $create_time_2=empty($_REQUEST['create_time_2'])?to_date($now,'Y-m-d'):strim($_REQUEST['create_time_2']);
  66. $create_time_2=to_timespan($create_time_2)+24*3600;
  67. if(trim($_REQUEST['create_time_1'])!='' )
  68. {
  69. // $map[DB_PREFIX.'weibo.create_time'] = array('between',array(to_timespan($_REQUEST['create_time_1']),$create_time_2));
  70. //$condition .= " and create_time between (".to_timespan($_REQUEST['create_time_1']).",".$create_time_2." ) ";
  71. $condition .= " and create_time>'".$create_time_1."' and create_time<'".$create_time_2."'";
  72. }
  73. log_result($condition);
  74. $count = M('PaymentNotice')->where($condition)->count();
  75. $p = new Page($count, $listRows = 20);
  76. //举报类型
  77. $weibo = M('PaymentNotice')->where($condition)->order('id desc')->limit($p->firstRow . ',' . $p->listRows)->findAll();
  78. $page = $p->show();
  79. $this->assign("page", $page);
  80. return $weibo;
  81. }
  82. public function foreverdelete() {
  83. //彻底删除指定记录
  84. $ajax = intval($_REQUEST['ajax']);
  85. $id = $_REQUEST ['id'];
  86. if (isset ( $id )) {
  87. $condition = array ('id' => array ('in', explode ( ',', $id ) ) );
  88. $rel_data = M('WeiboRed')->where($condition)->findAll();
  89. foreach($rel_data as $data)
  90. {
  91. $info[] = $data['user_id'].'的动态'.$data['id'];
  92. }
  93. if($info) $info = implode(",",$info);
  94. $list = M('WeiboRed')->where ( $condition )->delete();
  95. //删除相关预览图
  96. // foreach($rel_data as $data)
  97. // {
  98. // @unlink(get_real_path().$data['preview']);
  99. // }
  100. if ($list!==false) {
  101. save_log($info.l("FOREVER_DELETE_SUCCESS"),1);
  102. clear_auto_cache("get_help_cache");
  103. $this->success (l("FOREVER_DELETE_SUCCESS"),$ajax);
  104. } else {
  105. save_log($info.l("FOREVER_DELETE_FAILED"),0);
  106. $this->error (l("FOREVER_DELETE_FAILED"),$ajax);
  107. }
  108. } else {
  109. $this->error (l("INVALID_OPERATION"),$ajax);
  110. }
  111. }
  112. }
  113. ?>