💖💖更多项目资源,最下方联系IT实战课堂✨✨✨✨✨✨
博主拥有多年的T技术研发项目架构和教学经验,CSDN/51CTO/腾讯课堂等平台优质作者、高级讲师,培训机构联合创始人!现专注项目定制Java、小程序、前端网页、Python、App、NodeJs、PHP、微服务、NET等远程部署、售后答疑、文档编写指导等。
目录
一、项目技术介绍
大学本科专科计算机毕设项目毕业设计选题源码论文定制PHP基于H5实现企业管理设计和实现_哔哩哔哩_bilibili大学本科专科计算机毕设项目毕业设计选题源码论文定制PHP基于H5实现企业管理设计和实现共计2条视频,包括:H17 767-PHP基于H5实现企业管理设计和实现、福利大放送-网站-IT实战课堂等,UP主更多精彩视频,请关注UP账号。https://www.bilibili.com/video/BV1Tj411m7GV?share_source=copy_web该项目含有源码、文档、PPT、配套开发软件、软件安装教程、项目发布教程、包运行成功以及课程答疑与微信售后交流群、送查重系统不限次数免费查重等福利!
软件开发环境及开发工具:
后台语言:PHP
安卓框架:Uniapp
JDK版本:JDK1.8
服务器:tomcat9.0
数据库:mysql 5.7
数据库工具:Navicat11
开发软件:eclipse/myeclipse/idea
Maven包:Maven3.3.9
浏览器:谷歌浏览器
本系统功能完整,适合作为毕业设计、课程设计、数据库大作业 参考 以及学习商用皆可。
下面是资料信息截图:
二、项目功能介绍
功能介绍:
下面是系统运行起来后的一些截图:
三、相关代码
<?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实战课堂官网✨✨✨