💖💖更多项目资源,最下方联系IT实战课堂✨✨✨✨✨✨
博主拥有多年的T技术研发项目架构和教学经验,CSDN/51CTO/腾讯课堂等平台优质作者、高级讲师,培训机构联合创始人!现专注项目定制Java、小程序、前端网页、Python、App、NodeJs、PHP、微服务、NET等远程部署、售后答疑、文档编写指导等。
目录
一、项目技术介绍
二、项目配套文档-部分内容
资料获取
一、项目技术介绍
大学本科专科计算机毕设项目毕业设计源码论文定制PHP基于微信小程序的社区健康申报平台_哔哩哔哩_bilibili大学本科专科计算机毕设项目毕业设计源码论文定制PHP基于微信小程序的社区健康申报平台共计3条视频,包括:H32 782-PHP基于微信小程序的社区健康申报平台、小知识点分享-mysql服务器安装异常登录不上数据库解决方案、小知识点分享-mysql数据库服务端安装等,UP主更多精彩视频,请关注UP账号。https://www.bilibili.com/video/BV1gr4y197Ao?share_source=copy_web该项目含有源码、文档、PPT、配套开发软件、软件安装教程、项目发布教程、包运行成功以及课程答疑与微信售后交流群、送查重系统不限次数免费查重等福利!
软件开发环境及开发工具:
后台语言:PHP
安卓框架:Uniapp
JDK版本:JDK1.8
服务器:tomcat9.0
数据库:mysql 5.7
数据库工具:Navicat11
开发软件:eclipse/myeclipse/idea
Maven包:Maven3.3.9
浏览器:谷歌浏览器
本系统功能完整,适合作为毕业设计、课程设计、数据库大作业 参考 以及学习商用皆可。
下面是资料信息截图:
二、项目功能介绍
功能介绍:
下面是系统运行起来后的一些截图:
文章来源:https://www.toymoban.com/news/detail-842918.html
三、相关代码
<?php
session_start();
class ConfigController extends CommonController {
public function __construct()
{
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, DELETE");
header('Access-Control-Allow-Headers:Origin,Content-Type,Accept,token,X-Requested-With,device');
}
public $columData = [
'id','name','value'
];
/**
* 分页,列表
* get
*/
public function page(){
$token = $this->token();
$tokens = json_decode(base64_decode($token),true);
if (!isset($tokens['id']) || empty($tokens['id'])) exit(json_encode(['code'=>403,'msg'=>"你还没有登录。"]));
$userid = $tokens['id'];
$page = isset($_GET['page'])?$_GET['page']:"1";
$limt = isset($_GET['limit'])?$_GET['limit']:"10";
$sort = isset($_GET['sort'])?$_GET['sort']:"id";
$order = isset($_GET['order'])?$_GET['order']:"asc";
$where = "";//查询条件
$sql = "select * from `config`".$where;
$count = table_sql($sql);
if ($count->num_rows < 1){
$numberCount = 1;
}else{
$numberCount = $count->num_rows;
}
$page_count = ceil($numberCount/$limt);//页数
$startCount = ($page-1)*10;
$lists = "select * from `config` ".$where." order by ".$sort." ".$order." limit ".$startCount.",".$limt;
$result = table_sql($lists);
$arrayData = array();
if ($result->num_rows > 0) {
while ($datas = $result->fetch_assoc()){
array_push($arrayData,$datas);
}
}
exit(json_encode([
'code'=>0,
'data' => [
"total" => $numberCount,
"pageSize" => $limt,
"totalPage" => $page_count,
"currPage" => $page,
"list" => $arrayData
]
]));
}
/**
* 分页,列表list
* get
*/
public function lists(){
$page = isset($_GET['page'])?$_GET['page']:"1";
$limt = isset($_GET['limit'])?$_GET['limit']:"10";
$sort = isset($_GET['sort'])?$_GET['sort']:"id";
$order = isset($_GET['order'])?$_GET['order']:"asc";
$where = " where 1 ";//查询条件
$sql = "select * from `config`".$where;
$count = table_sql($sql);
if ($count->num_rows < 1){
$numberCount = 1;
}else{
$numberCount = $count->num_rows;
}
$page_count = ceil($numberCount/$limt);//页数
$startCount = ($page-1)*10;
$lists = "select * from `config` ".$where." order by ".$sort." ".$order." limit ".$startCount.",".$limt;
$result = table_sql($lists);
$arrayData = array();
if ($result->num_rows > 0) {
while ($datas = $result->fetch_assoc()){
array_push($arrayData,$datas);
}
}
exit(json_encode([
'code'=>0,
'data' => [
"total" => $numberCount,
"pageSize" => $limt,
"totalPage" => $page_count,
"currPage" => $page,
"list" => $arrayData
]
]));
}
/**
* 新增数据接口
* post
*/
public function save(){
$token = $this->token();
$tokens = json_decode(base64_decode($token),true);
if (!isset($tokens['id']) || empty($tokens['id'])) exit(json_encode(['code'=>403,'msg'=>"你还没有登录。"]));
$userid = $tokens['id'];
$keyArr = $valArr = array();
$tmpData = strval(file_get_contents("php://input"));//Content-Type: application/json 需要用到php://input 处理输入流
if (!empty($tmpData)&& isset($tmpData)){
$postData = json_decode($tmpData,true);
foreach ($postData as $key => $value){
if (in_array($key, $this->columData)){
if(!empty($value) || $value === 0) {
array_push($keyArr,"`".$key."`");
array_push($valArr,"'".$value."'");
}
}
}
}
$k = implode(',',$keyArr);
$v = implode(',',$valArr);
$sql = "INSERT INTO `config` (".$k.") VALUES (".$v.")";
$result = table_sql($sql);
if (!$result) exit(json_encode(['code'=>500,'msg'=>"新增失败"]));
exit(json_encode(['code'=>0]));
}
/**
* 更新接口
* post
*/
public function update(){
$tmpData = strval(file_get_contents("php://input"));
$postData = json_decode($tmpData,true);
$length = count($postData);
$v = array();
$i=0;
foreach ($postData as $key => $value){
if (in_array($key, $this->columData)){
if ($key == "id"){
$id = $value;
}
array_push($v,$key." = '".$value."'");
}
}
$value = implode(',',$v);
$sql = "UPDATE config SET ".$value." where id = ".$id;
$result = table_sql($sql);
if (!$result) echo json_encode(['code'=>500,'msg'=>"修改失败"]);
exit(json_encode(['code'=>0]));
}
/**
* 查询一条数据
* get
*/
public function info($id=false){
$token = $this->token();
$tokens = json_decode(base64_decode($token),true);
if (!isset($tokens['id']) || empty($tokens['id'])) exit(json_encode(['code'=>403,'msg'=>"你还没有登录。"]));
$userid = $tokens['id'];
$name = isset($_REQUEST['name'])? $_REQUEST['name']:"";
if (!empty($id)){
$where = "`id` = ".$id;
}else{
$where = "`name` = ".$name;
}
$sql = "select * from `config` where ".$where;
$result = table_sql($sql);
if (!$result) echo json_encode(['code'=>500,'msg'=>"查询数据发生错误。"]);
if ($result->num_rows > 0) {
// 输出数据
while($row = $result->fetch_assoc()) {
$lists = $row;
}
}
exit(json_encode([
'code'=>0,
'data'=> $lists
]));
}
}
资料获取
💖💖更多项目资源,最下方联系我们✨✨✨IT实战课堂官网✨✨✨文章来源地址https://www.toymoban.com/news/detail-842918.html
到了这里,关于php毕业设计源码社区健康申报小程序[源码+文档+答疑+远程的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!