select('openid', 'status', 'created_at') ->orderBy('created_at', 'desc'); // 搜索功能 if (!empty($searchInfo['info'])) { $list->where('openid', 'like', '%' . $searchInfo['info'] . '%'); } $count = $list->count(); $list = $list ->offset(($page - 1) * $pageSize) ->limit($pageSize) ->get(); return \Yz::Return(true, '获取成功', ['list' => $list, 'count' => $count]); } public function UpdateStatus(){ $openid = request('openid'); $status = request('status'); if (empty($openid) || $status === null) { return \Yz::echoError1('参数不完整'); } $result = DB::table('weixin_user') ->where('openid', $openid) ->update(['status' => $status]); if ($result) { return \Yz::Return(true, '修改成功'); } else { return \Yz::echoError1('修改失败'); } } }