|
|
|
|
@ -10,42 +10,43 @@ class WeixinUserController
|
|
|
|
|
$page = request('page', 1);
|
|
|
|
|
$pageSize = request('pageSize', 15);
|
|
|
|
|
$searchInfo = request('searchInfo', []);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$list = DB::table('weixin_user')
|
|
|
|
|
->select('openid', 'status', 'created_at')
|
|
|
|
|
->select('weixin_user.openid', 'weixin_user.status', 'weixin_user.created_at')
|
|
|
|
|
->join('liu_yan', 'weixin_user.openid', '=', 'liu_yan.openid')
|
|
|
|
|
->orderBy('created_at', 'desc');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 搜索功能
|
|
|
|
|
if (!empty($searchInfo['info'])) {
|
|
|
|
|
$list->where('openid', 'like', '%' . $searchInfo['info'] . '%');
|
|
|
|
|
$list->where('weixin_user.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('修改失败');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|