?????更多項目資源,最下方聯(lián)系IT實戰(zhàn)課堂??????
博主擁有多年的T技術研發(fā)項目架構和教學經(jīng)驗,CSDN/51CTO/騰訊課堂等平臺優(yōu)質(zhì)作者、高級講師,培訓機構聯(lián)合創(chuàng)始人!現(xiàn)專注項目定制Java、小程序、前端網(wǎng)頁、Python、App、NodeJs、PHP、微服務、NET等遠程部署、售后答疑、文檔編寫指導等。
目錄
一、項目技術介紹
二、項目配套文檔-部分內(nèi)容
資料獲取
一、項目技術介紹
大學本科??朴嬎銠C畢設項目畢業(yè)設計源碼論文定制PHP基于微信小程序的社區(qū)健康申報平臺_嗶哩嗶哩_bilibili大學本科專科計算機畢設項目畢業(yè)設計源碼論文定制PHP基于微信小程序的社區(qū)健康申報平臺共計3條視頻,包括:H32 782-PHP基于微信小程序的社區(qū)健康申報平臺、小知識點分享-mysql服務器安裝異常登錄不上數(shù)據(jù)庫解決方案、小知識點分享-mysql數(shù)據(jù)庫服務端安裝等,UP主更多精彩視頻,請關注UP賬號。https://www.bilibili.com/video/BV1gr4y197Ao?share_source=copy_web該項目含有源碼、文檔、PPT、配套開發(fā)軟件、軟件安裝教程、項目發(fā)布教程、包運行成功以及課程答疑與微信售后交流群、送查重系統(tǒng)不限次數(shù)免費查重等福利!
軟件開發(fā)環(huán)境及開發(fā)工具:
后臺語言:PHP
安卓框架:Uniapp
JDK版本:JDK1.8
服務器:tomcat9.0
數(shù)據(jù)庫:mysql 5.7
數(shù)據(jù)庫工具:Navicat11
開發(fā)軟件:eclipse/myeclipse/idea
Maven包:Maven3.3.9
瀏覽器:谷歌瀏覽器
本系統(tǒng)功能完整,適合作為畢業(yè)設計、課程設計、數(shù)據(jù)庫大作業(yè) 參考 以及學習商用皆可。
下面是資料信息截圖:
二、項目功能介紹
功能介紹:
下面是系統(tǒng)運行起來后的一些截圖:
文章來源:http://www.zghlxwxcb.cn/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);//頁數(shù)
$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);//頁數(shù)
$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
]
]));
}
/**
* 新增數(shù)據(jù)接口
* 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]));
}
/**
* 查詢一條數(shù)據(jù)
* 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'=>"查詢數(shù)據(jù)發(fā)生錯誤。"]);
if ($result->num_rows > 0) {
// 輸出數(shù)據(jù)
while($row = $result->fetch_assoc()) {
$lists = $row;
}
}
exit(json_encode([
'code'=>0,
'data'=> $lists
]));
}
}
資料獲取
????更多項目資源,最下方聯(lián)系我們???IT實戰(zhàn)課堂官網(wǎng)???文章來源地址http://www.zghlxwxcb.cn/news/detail-842918.html
到了這里,關于php畢業(yè)設計源碼社區(qū)健康申報小程序[源碼+文檔+答疑+遠程的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!