PaymentNoticeAction.class.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 PaymentNoticeAction extends CommonAction{
  10. public function index()
  11. {
  12. if(strim($_REQUEST['nick_name'])!=''){//name
  13. $user=M("User")->where("nick_name like '%".strim($_REQUEST['nick_name'])."%' ")->findAll();
  14. $user_arr_id = array();
  15. foreach($user as $k=>$v){
  16. $user_arr_id[$k] =intval($v['id']);
  17. }
  18. //$user_str_id = implode(',',$user_arr_id);
  19. $map['user_id'] = array('in',$user_arr_id);
  20. }
  21. $name=$this->getActionName();
  22. $model = D ($name);
  23. if($_REQUEST['payment_id']>0)
  24. {
  25. $payment_name = M("Payment")->where(" id = ".intval($_REQUEST['payment_id']))->getField("class_name");
  26. if($payment_name=="Wwxjspay"){
  27. $model = M ('UserRefund');
  28. $map['is_pay'] = 3;
  29. $map['withdrawals_type'] = 0;
  30. $is_cash = 1;
  31. }else{
  32. $map['payment_id'] = intval($_REQUEST['payment_id']);
  33. $map['is_paid'] = 1;
  34. $is_cash = 0;
  35. }
  36. }
  37. if (method_exists ( $this, '_filter' )) {
  38. $this->_filter ( $map );
  39. }
  40. if (! empty ( $model )) {
  41. $this->_list ( $model, $map );
  42. }
  43. $this->assign("is_cash",$is_cash);
  44. $this->display ();
  45. return;
  46. }
  47. public function delete() {
  48. //彻底删除指定记录
  49. $ajax = intval($_REQUEST['ajax']);
  50. $id = $_REQUEST ['id'];
  51. if (isset ( $id )) {
  52. $condition = array ('id' => array ('in', explode ( ',', $id ) ) );
  53. $rel_data = M(MODULE_NAME)->where($condition)->findAll();
  54. $list = M(MODULE_NAME)->where ( $condition )->delete();
  55. foreach($rel_data as $data)
  56. {
  57. $info[] = "[单号:".$data['notice_sn']."]";
  58. }
  59. if($info) $info = implode(",",$info);
  60. if ($list!==false) {
  61. save_log($info."成功删除",1);
  62. $this->success ("成功删除",$ajax);
  63. } else {
  64. save_log($info."删除出错",0);
  65. $this->error ("删除出错",$ajax);
  66. }
  67. } else {
  68. $this->error (l("INVALID_OPERATION"),$ajax);
  69. }
  70. }
  71. }
  72. ?>