UserRobotAction.class.php 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  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 UserRobotAction extends CommonAction{
  10. public function __construct()
  11. {
  12. require_once APP_ROOT_PATH."/admin/Lib/Action/UserCommonAction.class.php";
  13. parent::__construct();
  14. }
  15. //机器人
  16. public function index()
  17. {
  18. $common = new UserCommon();
  19. filter_request($_REQUEST);
  20. $data = $_REQUEST;
  21. $data['is_authentication'] = array('in',array(0,1,2,3));
  22. $data['is_robot'] = 1;
  23. $common->index($data);
  24. }
  25. public function add(){
  26. $common = new UserCommon();
  27. $common->add();
  28. }
  29. public function insert(){
  30. $common = new UserCommon();
  31. filter_request($_REQUEST);
  32. $data = $_REQUEST;
  33. $common->insert($data);
  34. }
  35. public function edit() {
  36. $common = new UserCommon();
  37. filter_request($_REQUEST);
  38. $data = $_REQUEST;
  39. $common->edit($data);
  40. }
  41. public function delete() {
  42. $common = new UserCommon();
  43. filter_request($_REQUEST);
  44. $data = $_REQUEST;
  45. $common->delete($data);
  46. }
  47. public function update() {
  48. $common = new UserCommon();
  49. filter_request($_REQUEST);
  50. $data = $_REQUEST;
  51. $common->update($data);
  52. }
  53. public function set_effect()
  54. {
  55. $common = new UserCommon();
  56. filter_request($_REQUEST);
  57. $data = $_REQUEST;
  58. $n_is_effect = $common->set_effect($data);
  59. $this->ajaxReturn($n_is_effect,l("SET_EFFECT_".$n_is_effect),1);
  60. }
  61. public function set_ban()
  62. {
  63. $common = new UserCommon();
  64. filter_request($_REQUEST);
  65. $data = $_REQUEST;
  66. $n_is_effect = $common->set_ban($data);
  67. $this->ajaxReturn($n_is_effect,l("SET_BAN_".$n_is_effect),1);
  68. }
  69. //新增关注
  70. public function add_focus(){
  71. $common = new UserCommon();
  72. filter_request($_REQUEST);
  73. $data = $_REQUEST;
  74. $common->add_focus($data);
  75. }
  76. //新增关注
  77. public function set_follow(){
  78. $common = new UserCommon();
  79. filter_request($_REQUEST);
  80. $data = $_REQUEST;
  81. $common->set_follow($data);
  82. }
  83. //关注列表
  84. public function focus_list(){
  85. $common = new UserCommon();
  86. filter_request($_REQUEST);
  87. $data = $_REQUEST;
  88. $common->focus_list($data);
  89. }
  90. //新增粉丝
  91. public function add_fans(){
  92. $common = new UserCommon();
  93. filter_request($_REQUEST);
  94. $data = $_REQUEST;
  95. $common->add_fans($data);
  96. }
  97. //新增粉丝
  98. public function set_follower(){
  99. $common = new UserCommon();
  100. filter_request($_REQUEST);
  101. $data = $_REQUEST;
  102. $common->set_follower($data);
  103. }
  104. //粉丝列表
  105. public function fans_list(){
  106. $common = new UserCommon();
  107. filter_request($_REQUEST);
  108. $data = $_REQUEST;
  109. $common->fans_list($data);
  110. }
  111. //删除关注
  112. public function del_focus_list(){
  113. $common = new UserCommon();
  114. filter_request($_REQUEST);
  115. $data = $_REQUEST;
  116. $common->del_focus_list($data);
  117. }
  118. //删除粉丝
  119. public function del_fans_list(){
  120. $common = new UserCommon();
  121. filter_request($_REQUEST);
  122. $data = $_REQUEST;
  123. $common->del_fans_list($data);
  124. }
  125. //印票贡献榜
  126. public function contribution_list(){
  127. $common = new UserCommon();
  128. filter_request($_REQUEST);
  129. $data = $_REQUEST;
  130. $common->contribution_list($data);
  131. }
  132. /**
  133. * 删除印票贡献榜
  134. */
  135. public function del_contribution_list()
  136. {
  137. filter_request($_REQUEST);
  138. $ajax = intval($_REQUEST['ajax']);
  139. $id = $_REQUEST ['id'];
  140. if (isset ( $id )) {
  141. $common = new UserCommon();
  142. $data = $_REQUEST;
  143. $status = $common->del_contribution_list($data);
  144. if ($status!==false) {
  145. $this->success (l("FOREVER_DELETE_SUCCESS"),$ajax);
  146. } else {
  147. $this->error (l("FOREVER_DELETE_FAILED"),$ajax);
  148. }
  149. } else {
  150. $this->error (l("INVALID_OPERATION"),$ajax);
  151. }
  152. }
  153. //消息推送
  154. public function push(){
  155. $common = new UserCommon();
  156. filter_request($_REQUEST);
  157. $data = $_REQUEST;
  158. $common->push($data);
  159. }
  160. //删除推送消息
  161. public function del_push(){
  162. filter_request($_REQUEST);
  163. $ajax = intval($_REQUEST['ajax']);
  164. $id = $_REQUEST ['id'];
  165. if (isset ( $id )) {
  166. $common = new UserCommon();
  167. $data = $_REQUEST;
  168. $status = $common->del_push($data);
  169. if ($status!==false) {
  170. $this->success (l("FOREVER_DELETE_SUCCESS"),$ajax);
  171. } else {
  172. $this->error (l("FOREVER_DELETE_FAILED"),$ajax);
  173. }
  174. } else {
  175. $this->error (l("INVALID_OPERATION"),$ajax);
  176. }
  177. }
  178. public function account()
  179. {
  180. $common = new UserCommon();
  181. filter_request($_REQUEST);
  182. $data = $_REQUEST;
  183. $status = $common->account($data);
  184. }
  185. public function modify_account()
  186. {
  187. $common = new UserCommon();
  188. filter_request($_REQUEST);
  189. $data = $_REQUEST;
  190. $status = $common->modify_account($data);
  191. $this->success(L("UPDATE_SUCCESS"));
  192. }
  193. public function account_detail()
  194. {
  195. $common = new UserCommon();
  196. filter_request($_REQUEST);
  197. $data = $_REQUEST;
  198. $common->account_detail($data);
  199. }
  200. //兑换日志
  201. public function exchange_log()
  202. {
  203. $common = new UserCommon();
  204. filter_request($_REQUEST);
  205. $data = $_REQUEST;
  206. $common->exchange_log($data);
  207. }
  208. public function foreverdelete_account_detail()
  209. {
  210. filter_request($_REQUEST);
  211. //彻底删除指定记录
  212. $ajax = intval($_REQUEST['ajax']);
  213. $id = $_REQUEST ['id'];
  214. $data = $_REQUEST;
  215. if (isset ( $id )) {
  216. $common = new UserCommon();
  217. $status = $common->foreverdelete_account_detail($data);
  218. if ($status!==false) {
  219. $this->success (l("FOREVER_DELETE_SUCCESS"),$ajax);
  220. } else {
  221. $this->error (l("FOREVER_DELETE_FAILED"),$ajax);
  222. }
  223. } else {
  224. $this->error (l("INVALID_OPERATION"),$ajax);
  225. }
  226. }
  227. //删除兑换日志
  228. public function foreverdelete_exchange_log()
  229. {
  230. filter_request($_REQUEST);
  231. //彻底删除指定记录
  232. $ajax = intval($_REQUEST['ajax']);
  233. $id = $_REQUEST ['id'];
  234. $data = $_REQUEST;
  235. if (isset ( $id )) {
  236. $common = new UserCommon();
  237. $status = $common->foreverdelete_exchange_log($data);
  238. if ($status!==false) {
  239. $this->success (l("FOREVER_DELETE_SUCCESS"),$ajax);
  240. } else {
  241. $this->error (l("FOREVER_DELETE_FAILED"),$ajax);
  242. }
  243. } else {
  244. $this->error (l("INVALID_OPERATION"),$ajax);
  245. }
  246. }
  247. public function check_user(){
  248. $common = new UserCommon();
  249. filter_request($_REQUEST);
  250. $user_id = $_REQUEST['id'];
  251. admin_ajax_return($common->check_user($user_id));
  252. }
  253. //礼物日志
  254. public function prop()
  255. {
  256. $common = new UserCommon();
  257. $data = $_REQUEST;
  258. $common->prop($data);
  259. }
  260. //删除礼物日志
  261. public function delete_prop()
  262. {
  263. //彻底删除指定记录
  264. $ajax = intval($_REQUEST['ajax']);
  265. $id = $_REQUEST ['id'];
  266. $data = $_REQUEST;
  267. if (isset ( $id )) {
  268. $common = new UserCommon();
  269. $status = $common->del_prop($data);
  270. if ($status!==false) {
  271. $this->success (l("FOREVER_DELETE_SUCCESS"),$ajax);
  272. } else {
  273. $this->error (l("FOREVER_DELETE_FAILED"),$ajax);
  274. }
  275. } else {
  276. $this->error (l("INVALID_OPERATION"),$ajax);
  277. }
  278. }
  279. //设置机器人送礼物特权
  280. public function roboter()
  281. {
  282. $id = intval($_REQUEST['id']);
  283. $c_is_roboter = M("User")->where("id=".$id)->getField("roboter"); //当前状态
  284. $n_is_roboter = $c_is_roboter == 0 ? 1 : 0; //需设置的状态
  285. $result=M("User")->where("id=".$id)->setField("roboter",$n_is_roboter);
  286. $user_data = array();
  287. if($result){
  288. fanwe_require(APP_ROOT_PATH.'mapi/lib/redis/BaseRedisService.php');
  289. fanwe_require(APP_ROOT_PATH.'mapi/lib/redis/UserRedisService.php');
  290. $user_redis = new UserRedisService();
  291. $user_data['roboter'] = $n_is_roboter;
  292. $user_redis->update_db($id,$user_data);
  293. }
  294. $this->ajaxReturn($n_is_roboter,l("roboter_".$n_is_roboter),1);
  295. }
  296. }
  297. ?>