作者 魏强
1 个管道 的构建 通过 耗费 4 秒

test

@@ -50,4 +50,14 @@ class OrderController extends AdminBaseController @@ -50,4 +50,14 @@ class OrderController extends AdminBaseController
50 return $this->fetch(); 50 return $this->fetch();
51 } 51 }
52 52
  53 + public function delete(){
  54 + $id=input('id');
  55 + $map['id']=$id;
  56 + $result=\db('order')->where($map)->delete();
  57 + if ($result==1){
  58 + return $this->success('操作成功!');
  59 + }else{
  60 + $this->error('编辑失败!');
  61 + }
  62 + }
53 } 63 }
@@ -79,8 +79,9 @@ class UserController extends AdminBaseController @@ -79,8 +79,9 @@ class UserController extends AdminBaseController
79 public function student() 79 public function student()
80 { 80 {
81 /**查询条件**/ 81 /**查询条件**/
82 - $where = ["user_type" => 2];  
83 - $where = ["student_type" => 1]; 82 + $where=[];
  83 + $where['user_type'] = 2;
  84 + $where['student_type'] =1;
84 /**搜索条件**/ 85 /**搜索条件**/
85 $user_nickname = $this->request->param('user_nickname'); 86 $user_nickname = $this->request->param('user_nickname');
86 $mobile = trim($this->request->param('mobile')); 87 $mobile = trim($this->request->param('mobile'));
@@ -96,6 +97,10 @@ class UserController extends AdminBaseController @@ -96,6 +97,10 @@ class UserController extends AdminBaseController
96 if ($mobile) { 97 if ($mobile) {
97 $where['mobile'] = $mobile ; 98 $where['mobile'] = $mobile ;
98 } 99 }
  100 +
  101 + if (empty($where)){
  102 + $where=1;
  103 + }
99 /**数据库检索**/ 104 /**数据库检索**/
100 $users = Db::name('user') 105 $users = Db::name('user')
101 ->where($where) 106 ->where($where)
@@ -128,7 +133,7 @@ class UserController extends AdminBaseController @@ -128,7 +133,7 @@ class UserController extends AdminBaseController
128 133
129 $res = DB::name('user')->where($datain)->find(); 134 $res = DB::name('user')->where($datain)->find();
130 if ($res) { 135 if ($res) {
131 - $this->error("该手机号数据库已经存在!"); 136 + $res = DB::name('user')->where($datain)->delete();
132 } 137 }
133 $datain['headimgurl'] = '/upload/' . $p['headimgurl']; 138 $datain['headimgurl'] = '/upload/' . $p['headimgurl'];
134 $datain['user_nickname'] = $p['user_nickname']; 139 $datain['user_nickname'] = $p['user_nickname'];
此 diff 太大无法显示。
1 -{"expire_time":1554981420,"access_token":"20_dwYKj4ic91DkCG_PT5M1N7A0V8qKOnlsvHudUjmgttbXAuA_wA66y1GzZD3DNlKzQetu264X9-qaz07Jxi4oXu-2UMnmoIDTlQyGTzjVX9mWxipIhDHr-i52TTsjbNtMAWN9SkMnR-kh7va8QSYaAGAVXD"}  
  1 +{"expire_time":1560574854,"access_token":"22_sRJ_WBjoNBnSRPhlL7Mi9Iyc430u6yTO6QNUOtXCzDvMNpO6lPXLg1W7RM4a0PbVKSQ-14Ho5ztPiiANxJWgv6hLHSBVuz1ZgHKng3rPqXOil1n6DE6Bzjd50ZxFToVv_TNiYxJrE3O3l7m1OBEeAEAZMP"}
1 -{"expire_time":1554981420,"jsapi_ticket":"HoagFKDcsGMVCIY2vOjf9pyFzo-WRmf981mGkqnXm7qB7U21m-aQV42MlQiGoiE3ulz_kXxb8RBRKnyv1Rfrxg"}  
  1 +{"expire_time":1560574854,"jsapi_ticket":"HoagFKDcsGMVCIY2vOjf9pyFzo-WRmf981mGkqnXm7pbNNPi_-fei55KJn5hV-djv-WQg_ohiumwH-S7ipoP5w"}
@@ -61,6 +61,7 @@ @@ -61,6 +61,7 @@
61 <td>{$vo.status|pay_type_name}</td> 61 <td>{$vo.status|pay_type_name}</td>
62 <td> 62 <td>
63 <a href='{:url("admin/user/student",array("id"=>$vo["uid"]))}'>查看学员详情</a> 63 <a href='{:url("admin/user/student",array("id"=>$vo["uid"]))}'>查看学员详情</a>
  64 + <a class="js-ajax-delete" href="{:url('order/delete',['id'=>$vo.id])}">删除</a>
64 </td> 65 </td>
65 </tr> 66 </tr>
66 </foreach> 67 </foreach>