PushAnchorAction.class.php 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Fanwe 方维p2p借贷系统
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2011 http://www.fanwe.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Author: 云淡风轻(1956838968@qq.com)
  8. // +----------------------------------------------------------------------
  9. class PushAnchorAction extends CommonAction{
  10. public function index()
  11. {
  12. $now=get_gmtime();
  13. if(strim($_REQUEST['nick_name'])!=''){
  14. $map['nick_name'] = array('like','%'.strim($_REQUEST['nick_name']).'%');
  15. }
  16. if(strim($_REQUEST['room_id'])!='')
  17. {
  18. $map['room_id']=array('like','%'.strim($_REQUEST['room_id']).'%');
  19. }
  20. if(strim($_REQUEST['status'])!='')
  21. {
  22. $map['status']=$_REQUEST['status'];
  23. }
  24. if(strim($_REQUEST['pust_type'])!='')
  25. {
  26. $map['pust_type']=$_REQUEST['pust_type'];
  27. }
  28. $create_time_2=empty($_REQUEST['create_time_2'])?to_date($now,'Y-m-d'):strim($_REQUEST['create_time_2']);
  29. $create_time_2=to_timespan($create_time_2)+24*3600;
  30. if(trim($_REQUEST['create_time_1'])!='')
  31. {
  32. $map['create_time'] = array('between',array(to_timespan($_REQUEST['create_time_1']),$create_time_2));
  33. }
  34. if (method_exists ( $this, '_filter' )) {
  35. $this->_filter ( $map );
  36. }
  37. $name=$this->getActionName();
  38. $model = D ($name);
  39. if (! empty ( $model )) {
  40. $this->_list ( $model, $map );
  41. }
  42. $this->display ();
  43. }
  44. //彻底删除指定记录
  45. public function delete() {
  46. //彻底删除指定记录
  47. $ajax = intval($_REQUEST['ajax']);
  48. $id = $_REQUEST ['id'];
  49. if (isset ( $id )) {
  50. $condition = array ('id' => array ('in', explode ( ',', $id ) ) );
  51. $rel_data = M(MODULE_NAME)->where($condition)->findAll();
  52. foreach($rel_data as $data)
  53. {
  54. $info[] = $data['room_id'];
  55. }
  56. if($info) $info = implode(",",$info);
  57. $list = M(MODULE_NAME)->where ( $condition )->delete();
  58. if ($list!==false) {
  59. //删除子动画
  60. save_log($info.l("FOREVER_DELETE_SUCCESS"),1);
  61. $this->success (l("FOREVER_DELETE_SUCCESS"),$ajax);
  62. } else {
  63. save_log($info.l("FOREVER_DELETE_FAILED"),0);
  64. $this->error (l("FOREVER_DELETE_FAILED"),$ajax);
  65. }
  66. } else {
  67. $this->error (l("INVALID_OPERATION"),$ajax);
  68. }
  69. }
  70. }
  71. ?>