基于微信小程序的疫苗预约系统让疫苗信息,疫苗预约信息等相关信息集中在后台让管理员管理,让用户在小程序端预约疫苗,查看疫苗预约信息,该系统让信息管理变得高效,也让用户预约疫苗,查看疫苗预约等信息变得越来越方便。
一、项目简述
本系统功能包括:
1、疫苗添加、修改、删除等管理
2、接种点管理(接种点、工作人员)
3、预约跟进(预约、签到、预检、接种、留观、留观历史)
4、用户管理
1、小程序预约的界面展示
2、医生管理控制器
<?php
namespace app\store\controller;
use app\store\model\Doctors as DoctorsModel;
class Doctors extends Controller
{
public function index()
{
$model = new DoctorsModel;
$list = $model->getList();
return $this->fetch('index', compact('list'));
}
3、添加医生
public function add()
{
if (!$this->request->isAjax()) {
return $this->fetch('add');
}
$model = new DoctorsModel;
if ($model->add($this->postData('doctors'))) {
return $this->renderSuccess('添加成功', url('doctors/index'));
}
$error = $model->getError() ?: '添加失败';
return $this->renderError($error);
}
public function delete($doctors_id)
{
$model = DoctorsModel::get($doctors_id);
if (!$model->remove()) {
return $this->renderError('删除失败');
}
return $this->renderSuccess('删除成功');
}
4、医生编辑
public function edit($doctors_id)
{
$model = DoctorsModel::detail($doctors_id);
if (!$this->request->isAjax()) {
return $this->fetch('edit', compact('model'));
}
if ($model->edit($this->postData('doctors'))) {
return $this->renderSuccess('更新成功', url('doctors/index'));
}
$error = $model->getError() ?: '更新失败';
return $this->renderError($error);
}
}
5、订单管理
<?php
namespace app\store\controller;
use app\store\model\Order as OrderModel;
class Order extends Controller
{
public function delivery_list()
{
return $this->getList('待发货订单列表', [
'pay_status' => 20,
'delivery_status' => 10
]);
}
public function receipt_list()
{
return $this->getList('已付款订单列表', ['status' => 1]);
}
public function pay_list()
{
return $this->getList('待付款订单列表', ['status' => 0]);
}
public function complete_list()
{
return $this->getList('已完成订单列表', ['status' => 2]);
}
public function cancel_list()
{
return $this->getList('已取消订单列表', ['status' => -1]);
}
public function all_list()
{
return $this->getList('全部订单列表');
}
6、订单列表、订单详情控制器
private function getList($title, $filter = [])
{
$model = new OrderModel;
$list = $model->getList($filter);
return $this->fetch('index', compact('title','list'));
}
public function detail($order_id)
{
$detail = OrderModel::detail($order_id);
return $this->fetch('detail', compact('detail'));
}
7、确认发货
public function delivery($order_id)
{
$model = OrderModel::detail($order_id);
if ($model->delivery($this->postData('order'))) {
return $this->renderSuccess('发货成功');
}
$error = $model->getError() ?: '发货失败';
return $this->renderError($error);
}
}
8、在后台设置可以进行预约接种疫苗的时间段
9、疫苗上架的功能界面图:
10、订阅的用户信息管理
11、预约的用户信息管理
12、预约的用户信息管理详情页,后台管理员也可以手动为客户修改预约日期
13、导出订阅用户
<?php
namespace app\store\controller;
use think\Db;
use think\Log;
Class Output extends Controller
{
public function outExcel(){
vendor("PHPExcel.PHPExcel");
$objPHPExcel = new \PHPExcel();
$orders = session('output_orders');
$objPHPExcel->setActiveSheetIndex(0)
->setCellValue('A1', '名字')
->setCellValue('B1', '排号')
->setCellValue('C1', '电话')
->setCellValue('D1', '疫苗种类')
->setCellValue('E1', '年龄')
->setCellValue('F1', '出生日期')
->setCellValue('G1', '身份证号')
->setCellValue('H1', '发货状态')
->setCellValue('I1', '订阅时间')
->setCellValue('J1', '发货时间')
->setCellValue('K1', '渠道来源')
->setCellValue('L1', '分销员');
$arr = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L'];
$objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth(15);
$objPHPExcel->getActiveSheet()->getColumnDimension('B')->setWidth(10);
$objPHPExcel->getActiveSheet()->getColumnDimension('C')->setWidth(15);
$objPHPExcel->getActiveSheet()->getColumnDimension('D')->setWidth(25);
$objPHPExcel->getActiveSheet()->getColumnDimension('E')->setWidth(10);
$objPHPExcel->getActiveSheet()->getColumnDimension('F')->setWidth(15);
$objPHPExcel->getActiveSheet()->getColumnDimension('G')->setWidth(25);
$objPHPExcel->getActiveSheet()->getColumnDimension('H')->setWidth(15);
$objPHPExcel->getActiveSheet()->getColumnDimension('I')->setWidth(20);
$objPHPExcel->getActiveSheet()->getColumnDimension('J')->setWidth(20);
$objPHPExcel->getActiveSheet()->getColumnDimension('K')->setWidth(15);
$objPHPExcel->getActiveSheet()->getColumnDimension('K')->setWidth(15);
for($i = 0; $i < count($arr); $i++){
$objPHPExcel->getActiveSheet()->getStyle($arr[$i].'1')->getFont()->setBold(true);
$objPHPExcel->getActiveSheet()->getStyle($arr[$i].'1')->getFont()->setSize(12);
$objPHPExcel->getActiveSheet()->getStyle($arr[$i].'1')->getAlignment()->setVertical(\PHPExcel_Style_Alignment::VERTICAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle($arr[$i].'1')->getAlignment()->setHorizontal(\PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
}
$objPHPExcel->getActiveSheet()->getRowDimension(1)->setRowHeight(30);
for($i = 2; $i <= count($orders) + 1; $i++){
$objPHPExcel->getActiveSheet()->getStyle('A'.$i)->getAlignment()->setVertical(\PHPExcel_Style_Alignment::VERTICAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle('A'.$i)->getAlignment()->setHorizontal(\PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle('B'.$i)->getAlignment()->setVertical(\PHPExcel_Style_Alignment::VERTICAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle('B'.$i)->getAlignment()->setHorizontal(\PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle('C'.$i)->getAlignment()->setVertical(\PHPExcel_Style_Alignment::VERTICAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle('C'.$i)->getAlignment()->setHorizontal(\PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle('D'.$i)->getAlignment()->setVertical(\PHPExcel_Style_Alignment::VERTICAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle('D'.$i)->getAlignment()->setHorizontal(\PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle('E'.$i)->getAlignment()->setVertical(\PHPExcel_Style_Alignment::VERTICAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle('E'.$i)->getAlignment()->setHorizontal(\PHPExcel_Style_Alignment::HORIZONTAL_CENTER)