作者 sgj
1 个管道 的构建 失败 耗费 10 秒

商品下单修改

... ... @@ -37,7 +37,20 @@ class ClockController extends AdminBaseController
return $this->fetch();
}
public function addclock(){
$param=input();
dump($param);
$map['j.id']=$param['id'];
$data= db('join')->alias('j')
->field('v.name as user_name,v.photo,v.sex,v.birthday,v.move_phone,v.card_number as id_card,j.*,a.activity_name,a.start_time')
->join('user u','u.id=j.user_id')
->join('volunteer v','v.user_id=j.user_id')
->join('activity a','a.id=j.activity_id')
->where($map)
->find();
$this->assign('data',$data);
return $this->fetch();
}
public function info(){
$param=$this->request->param();
... ...
<?php
/**
* Created by PhpStorm.
* auther: sgj
* Date: 2020/10/18
* Time: 13:07
*/
namespace app\admin\controller;
use cmf\controller\AdminBaseController;
use cmf\controller\BaseController;
class JoinController extends AdminBaseController
{
public function index(){
$param=$this->request->param();
$map=[];
$data= db('join')->alias('j')
->field('v.name as user_name,v.photo,j.*,a.activity_name')
->join('user u','u.id=j.user_id')
->join('volunteer v','v.user_id=j.user_id')
->join('activity a','a.id=j.activity_id')
->where($map)
->order('j.id desc')
->paginate();
$data->appends($param);
$list=$data->items();
$this->assign([
'data'=>$list,
'page'=>$data->render(),
]);
return $this->fetch();
}
public function edit(){
$id=input('id');
$map['j.id']=$id;
$data= db('join')->alias('j')
->field('v.name as user_name,v.photo,v.sex,v.birthday,v.move_phone,v.card_number as id_card,j.*,a.activity_name')
->join('user u','u.id=j.user_id')
->join('volunteer v','v.user_id=j.user_id')
->join('activity a','a.id=j.activity_id')
->where($map)
->find();
//dump($data);
$this->assign('data',$data);
return $this->fetch();
}
public function editPost(){
$id=input('id');
$update['status']=input('status');
$result=db('join')->where('id',$id)->update($update);
if ($result==1){
$this->success('操作成功');
}else{
$this->error('操作失败');
}
}
}
\ No newline at end of file
... ...
... ... @@ -11,6 +11,7 @@ return array (
'ADMIN_HOOK_PLUGINLISTORDER' => '钩子插件排序',
'ADMIN_HOOK_PLUGINS' => '钩子插件管理',
'ADMIN_HOOK_SYNC' => '同步钩子',
'ADMIN_JOIN_INDEX' => '活动申请管理 ',
'ADMIN_LINK_ADD' => '添加友情链接',
'ADMIN_LINK_ADDPOST' => '添加友情链接提交保存',
'ADMIN_LINK_DELETE' => '删除友情链接',
... ...
<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li><a href="{:url('index')}">打卡列表</a></li>
<li class="active">
<a href="{:url('add')}">打卡添加</a>
</li>
</ul>
<form action="{:url('addPost')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
<div class="row">
<div class="col-md-9">
<table class="table table-bordered">
<tr>
<th width="100">名称(限20字)<span class="form-required">*</span></th>
<td>
<input class="form-control" type="text" name="activity_name"
id="title" value="{$data.activity_name}" placeholder="请输入活动名称"/>
<input type="hidden" name="id" value="{$data.id}">
</td>
</tr>
<tr>
<th width="100">活动日期<span class="form-required">*</span></th>
<td>
<input class="form-control js-date" type="text" name="date"
type="time" id="title" value="{:date('Y-m-d',$data.start_time)}" placeholder="请输入"/>
</td>
</tr>
<tr>
<th width="100">经度<span class="form-required">*</span></th>
<td>
<input class="form-control" type="text" name="long"
type="text" id="lng" value="{$data.long|default=''}" placeholder="请输入"/>
<text id="selectBtn">点击地图选择坐标</text>
</td>
</tr>
<tr>
<th width="100">纬度<span class="form-required">*</span></th>
<td>
<input class="form-control" type="text" name="lat"
type="text" id="lat" value="{$data.lat|default=''}" placeholder="请输入"/>
</td>
</tr>
<tr>
<th width="100">开始打卡时间<span class="form-required">*</span></th>
<td>
<input class="form-control" type="time" name="start_clock_time"
type="time" id="title" value="" placeholder="请输入"/>
</td>
</tr>
<tr>
<th width="100">结束打卡时间<span class="form-required">*</span></th>
<td>
<input class="form-control date-time" type="time" name="end_clock_time"
type="time" value="" placeholder="请输入"/>
</td>
</tr>
</table>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary js-ajax-submit">{:lang('SAVE')}</button>
<a class="btn btn-default" href="javascript:history.back(-1);">{:lang('BACK')}</a>
</div>
</div>
</div>
</div>
</form>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
//编辑器路径定义
var editorURL = GV.WEB_ROOT;
var SelectLocation = {
init:function(config){
var eleId = config.id;
var mapUrl = config.url;
var winHeight = config.height || 800;
var winWidth = config.width || 1024;
var winTop = config.top || 50;
var winLeft = config.left || 100;
this.callbackFun = config.callback;
if(!eleId){
alert('元素id不能为空');
return;
}
if(!mapUrl){
alert('地图url不能为空');
return;
}
var ele = document.getElementById(eleId);
ele.addEventListener('click',function(){
window.open(mapUrl,'selectLocation','fullscreen=0,directories=0,location=0,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,' +
'height='+winHeight+',width='+winWidth+',top='+winTop+',left='+winLeft+'');
});
},
callbackFun:null,
selectCallback:function(selectedLocation){
console.log('12121212');
if(this.callbackFun){
this.callbackFun(selectedLocation);
}
}
}
</script>
<script src="__TMPL__/public/assets/js/selectLocation.js"></script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript">
$(function () {
editorcontent = new baidu.editor.ui.Editor();
editorcontent.render('content');
try {
editorcontent.sync();
} catch (err) {
}
$('.btn-cancel-thumbnail').click(function () {
$('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#thumbnail').val('');
});
$('.btn-cancel-thumbnail1').click(function () {
$('#thumbnail-preview1').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#thumbnail1').val('');
});
});
</script>
<script type="text/javascript">
$('.btn-cancel-thumbnail').click(function () {
$('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#thumbnail').val('');
});
$('.btn-cancel-thumbnail2').click(function () {
$('#thumbnail2-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#thumbnail2').val('');
});
$('.btn-cancel-thumbnail3').click(function () {
$('#thumbnail3-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#thumbnail3').val('');
});
// 百度地图API功能
var center = new BMap.Point({$data.long|default='116.404'}, {$data.lat|default='39.915'});
var map = new BMap.Map("allmap");
map.centerAndZoom(new BMap.Point(116.404, 39.915), 8);
map.enableScrollWheelZoom(); //启用滚轮放大缩小,默认禁用
map.enableContinuousZoom();
var map_ac = new BMap.Autocomplete( //建立一个自动完成的对象
{
"input": "aaa",
"location": map
});
var marker = new BMap.Marker(center); // 创建标注
map.addOverlay(marker); // 将标注添加到地图中
marker.enableDragging(); //可拖拽
//marker.setAnimation(BMAP_ANIMATION_BOUNCE);
map_ac.addEventListener("onconfirm", function (e) { //鼠标点击下拉列表后的事件
var _value = e.item.value;
function myFun() {
var pp = local.getResults().getPoi(0).point; //获取第一个智能搜索的结果
map.centerAndZoom(pp, 8);
marker.setPosition(pp);
mgetLocation(pp);
}
myValue = _value.province + _value.city + _value.district + _value.street + _value.business;
var local = new BMap.LocalSearch(map, { //智能搜索
onSearchComplete: myFun
});
local.search(myValue);
});
var opts = {
width: 200, // 信息窗口宽度
height: 30, // 信息窗口高度
title: "", // 信息窗口标题
enableMessage: false,//设置允许信息窗发送短息
}
var infoWindow = new BMap.InfoWindow("拖动我设置你的位置", opts); // 创建信息窗口对象
marker.openInfoWindow(infoWindow);
var gc = new BMap.Geocoder();
function msetpoint(e) {
document.getElementById("lng_input").value = e.point.lng;
document.getElementById("lat_input").value = e.point.lat;
marker.setPosition(new BMap.Point(e.point.lng, e.point.lat));
mgetLocation(e.point);
}
function mgetLocation(point) {
gc.getLocation(point, function (rs) {
console.log(rs);
var addComp = rs.addressComponents;
marker.openInfoWindow(new BMap.InfoWindow(rs.address, opts));
document.getElementById("address_input").value = rs.address;
document.getElementById("city_input").value = addComp.city;
document.getElementById("province_input").value = addComp.province;
document.getElementById("district_input").value = addComp.district;
document.getElementById("lng_input").value = rs.point.lng;
document.getElementById("lat_input").value = rs.point.lat;
//alert(addComp.province + ", " + addComp.city + ", " + addComp.district + ", " + addComp.street + ", " + addComp.streetNumber);
});
}
marker.addEventListener("dragend", msetpoint)
map.addEventListener("click", msetpoint);
function tilesloaded() {
map.setCenter(center); //设置地图中心点。center除了可以为坐标点以外,还支持城市名
mgetLocation(center);
// map.setZoom(8); //将视图切换到指定的缩放等级,中心点坐标不变
map.removeEventListener("tilesloaded", tilesloaded);
}
map.addEventListener("tilesloaded", tilesloaded);
function confirm() {
var data = {};
data.lng = document.getElementById("lng_input").value;
data.lat = document.getElementById("lat_input").value;
data.address = document.getElementById("address_input").value;
data.city = document.getElementById("city_input").value;
data.province = document.getElementById("province_input").value;
data.district = document.getElementById("district_input").value;
return data;
}
</script>
<script type="text/javascript">
SelectLocation.init({
id:'selectBtn', //打开地图窗口按钮的ID
url:'/txmap.html', //地图页面的地址
// width:'1024', //打开地图窗口的宽度,可不传
// height:'800', //打开地图窗口的高度,可不传
// top:'50', //打开地图窗口距显示器顶部的距离,可不传
// left:'100', //打开地图窗口显示器左边的距离,可不传
callback:function(selectedLocation){
var lat = document.getElementById('lat');
var lng = document.getElementById('lng');
console.log(selectedLocation);
var gps=selectedLocation.location.split(",");
if (gps==''){
return false;
}
console.log(gps)
lat.value =gps['1'];
lng.value =gps['0'];
}
});
</script>
</body>
</html>
... ...
<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li><a href="{:url('index')}">活动报名列表</a></li>
<li class="active"><a href="#">审核报名</a></li>
</ul>
<form action="{:url('editPost')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
<div class="row">
<div class="col-md-9">
<table class="table table-bordered">
<tr>
<th width="100">姓名<span class="form-required">*</span></th>
<td>
<input class="form-control" type="text"
id="name" value="{$data.user_name}" placeholder="姓名"/>
<input type="hidden" name="id" value="{$data.id}">
</td>
</tr>
<tr>
<th width="100">性别<span class="form-required">*</span></th>
<td>
<input class="form-control" type="text"
id="sex" value="{$data.sex}" readonly placeholder="姓名"/>
</td>
</tr>
<tr>
<th width="100">出生日期<span class="form-required">*</span></th>
<td>
<input class="form-control" type="text"
id="birthday" value="{$data.birthday}" readonly placeholder="出生日期"/>
</td>
</tr>
<tr>
<th width="100">电话<span class="form-required">*</span></th>
<td>
<input class="form-control" type="text"
id="move_phone" value="{$data.move_phone}" readonly placeholder="电话"/>
</td>
</tr>
<tr>
<th width="100">身份证号<span class="form-required">*</span></th>
<td>
<input class="form-control" type="text"
id="id_card" value="{$data.id_card}" readonly placeholder=""/>
</td>
</tr>
<tr>
<th width="100">工作类型<span class="form-required">*</span></th>
<td>
<select disabled class="form-control" name="type" id="more-template-select">
<option value="1" <if condition="$data.type==1"> selected</if>>线上</option>
<option value="2" <if condition="$data.type==2"> selected</if>>线下</option>
<option value="3" <if condition="$data.type==3"> selected</if>>线上及线上</option>
</select>
</td>
</tr>
<tr>
<th width="100">工作内容<span class="form-required">*</span></th>
<td>
<select disabled class="form-control" name="work_content" id="more-template-select">
<option value="1" <if condition="$data.work_content==1"> selected</if>>摄影(设备自带)</option>
<option value="2" <if condition="$data.work_content==2"> selected</if>>摄像(设备自带)</option>
<option value="3" <if condition="$data.work_content==3"> selected</if>>爱心车队</option>
<option value="4" <if condition="$data.work_content==4"> selected</if>> 现场服务(签到、指引、礼仪等)</option>
<option value="5" <if condition="$data.work_content==5"> selected</if>>线上答疑</option>
<option value="6" <if condition="$data.work_content==6"> selected</if>>门诊服务</option>
<option value="7" <if condition="$data.work_content==7"> selected</if>>线上及线上</option>
</select>
</td>
</tr>
<php>
$select_time=json_decode($data['select_time'],true);
</php>
<tr>
<th width="100">选择日期<span class="form-required">*</span></th>
<td>
<foreach name="$select_time" id="vo">
<input class="form-control" type="text"
id="id_card" value="{$vo.date} {$vo.time}" readonly placeholder=""/>
</foreach>
</td>
</tr>
<php>
$apply_stay=json_decode($data['apply_stay'],true);
</php>
<tr>
<th width="100">申请入驻<span class="form-required">*</span></th>
<td>
<foreach name="$select_time" id="vo">
<input class="form-control" type="text"
id="id_card" value="{$vo.date}" readonly placeholder=""/>
</foreach>
</td>
</tr>
<php>
$apply_food=json_decode($data['apply_food'],true);
</php>
<tr>
<th width="100">申请用餐<span class="form-required">*</span></th>
<td>
<foreach name="apply_food" id="vo">
<input class="form-control" type="text"
id="id_card" value="{$vo.date}{$vo.time}" readonly placeholder=""/>
</foreach>
</td>
</tr>
<tr>
<th width="100">报名状态<span class="form-required">*</span></th>
<td>
<label><input type="radio" name="status" value="0" <eq name="$data.status" value="0">checked</eq> >未审核</label>
<label><input type="radio" name="status" value="1" <eq name="$data.status" value="1">checked</eq> >已通过</label>
<label><input type="radio" name="status" value="2" <eq name="$data.status" value="2">checked</eq> >未通过</label>
<label><input type="radio" name="status" value="3" <eq name="$data.status" value="2">checked</eq> >已签到</label>
</td>
</tr>
</table>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary js-ajax-submit">{:lang('SAVE')}</button>
<a class="btn btn-default" href="javascript:history.back(-1);">{:lang('BACK')}</a>
</div>
</div>
</div>
</div>
</form>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
//编辑器路径定义
var editorURL = GV.WEB_ROOT;
var SelectLocation = {
init:function(config){
var eleId = config.id;
var mapUrl = config.url;
var winHeight = config.height || 800;
var winWidth = config.width || 1024;
var winTop = config.top || 50;
var winLeft = config.left || 100;
this.callbackFun = config.callback;
if(!eleId){
alert('元素id不能为空');
return;
}
if(!mapUrl){
alert('地图url不能为空');
return;
}
var ele = document.getElementById(eleId);
ele.addEventListener('click',function(){
window.open(mapUrl,'selectLocation','fullscreen=0,directories=0,location=0,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,' +
'height='+winHeight+',width='+winWidth+',top='+winTop+',left='+winLeft+'');
});
},
callbackFun:null,
selectCallback:function(selectedLocation){
console.log('12121212');
if(this.callbackFun){
this.callbackFun(selectedLocation);
}
}
}
</script>
<script src="__TMPL__/public/assets/js/selectLocation.js"></script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript">
$(function () {
editorcontent = new baidu.editor.ui.Editor();
editorcontent.render('content');
try {
editorcontent.sync();
} catch (err) {
}
$('.btn-cancel-thumbnail').click(function () {
$('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#thumbnail').val('');
});
$('.btn-cancel-thumbnail1').click(function () {
$('#thumbnail-preview1').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#thumbnail1').val('');
});
});
</script>
<script type="text/javascript">
$('.btn-cancel-thumbnail').click(function () {
$('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#thumbnail').val('');
});
$('.btn-cancel-thumbnail2').click(function () {
$('#thumbnail2-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#thumbnail2').val('');
});
$('.btn-cancel-thumbnail3').click(function () {
$('#thumbnail3-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#thumbnail3').val('');
});
</script>
<script type="text/javascript">
SelectLocation.init({
id:'selectBtn', //打开地图窗口按钮的ID
url:'/txmap.html', //地图页面的地址
// width:'1024', //打开地图窗口的宽度,可不传
// height:'800', //打开地图窗口的高度,可不传
// top:'50', //打开地图窗口距显示器顶部的距离,可不传
// left:'100', //打开地图窗口显示器左边的距离,可不传
callback:function(selectedLocation){
var lat = document.getElementById('lat');
var lng = document.getElementById('lng');
console.log(selectedLocation);
var gps=selectedLocation.location.split(",");
if (gps==''){
return false;
}
console.log(gps)
lat.value =gps['1'];
lng.value =gps['0'];
}
});
</script>
</body>
</html>
... ...
<include file="public@header" />
</head>
<body>
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li class="active"><a href="{:url('index')}">打卡列表</a></li>
<li>
<a href="{:url('add')}">打卡添加</a>
</li>
</ul>
<!-- <form class="well form-inline margin-top-20" method="post" action="{:url('activity/index')}">
关键字:
<input type="text" class="form-control" name="keyword" style="width: 150px;" value="{$keyword|default=''}" placeholder="请输入关键字">
<input type="submit" class="btn btn-primary" value="搜索" />
<a class="btn btn-danger" href="{:url('activity/index')}">清空</a>
</form>-->
<form class="js-ajax-form" action="" method="post">
<table class="table table-hover table-bordered">
<thead>
<tr>
<th width="20">id</th>
<th width="50">活动名称</th>
<th width="50">用户信息</th>
<th width="50">工作类型</th>
<th width="50">工作内容</th>
<th width="50">提交时间</th>
<th width="50">状态</th>
<th width="100">操作</th>
</tr>
</thead>
<tbody>
<foreach name="data" item="vo">
<tr>
<td>{$vo.id}</td>
<td>{$vo.activity_name}</td>
<td>{$vo.user_name}</td>
<td>
<if condition="$vo.type==1"> 线上 </if>
<if condition="$vo.type==2"> 线下 </if>
<if condition="$vo.type==3"> 线上及线下</if>
</td>
<td>
<if condition="$vo.work_content==1"> 摄影(设备自带)</if>
<if condition="$vo.work_content==2"> 摄像(设备自带)</if>
<if condition="$vo.work_content==3"> 爱心车队 </if>
<if condition="$vo.work_content==4"> 现场服务(签到、指引、礼仪等)</if>
<if condition="$vo.work_content==5"> 线上答疑</if>
<if condition="$vo.work_content==6"> 门诊服务</if>
</td>
<td>{:date('Y-m-d H:i:s',$vo.add_time)}</td>
<td>
<if condition="$vo.status==0"> 未审核</if>
<if condition="$vo.status==1"> 已通过</if>
<if condition="$vo.status==2"> 未通过 </if>
<if condition="$vo.status==3"> 已签到 </if>
</td>
<td>
<a href='{:url("edit",array("id"=>$vo["id"]))}'>查看详情</a>|
<a href='{:url("clock/addClock",array("id"=>$vo["id"]))}'>添加活动打卡</a>
</td>
</tr>
</foreach>
</tbody>
</table>
<div class="pagination">{$page}</div>
</form>
</div>
<script src="__STATIC__/js/admin.js"></script>
</body>
</html>
\ No newline at end of file
... ...