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

修改志愿者列表

... ... @@ -21,6 +21,10 @@ class ClockController extends AdminBaseController
public function index(){
$param=$this->request->param();
$map=[];
if(!empty($param['keyword'])){
$map['c.activity_name']=['like',"%$param[keyword]%"];
}
$data= db('clock')->alias('c')
->field('v.name as user_name,v.photo,c.*')
->join('user u','u.id=c.user_id')
... ... @@ -33,7 +37,9 @@ class ClockController extends AdminBaseController
$this->assign([
'data'=>$list,
'page'=>$data->render(),
]);
'keyword'=>$param['keyword']??''
]);
return $this->fetch();
}
... ...
... ... @@ -92,6 +92,20 @@ class OnlineTrainController extends AdminBaseController
}
/**
* 删除对应问题
*/
public function delete(){
$id=input('id');
$result=db('class_question')->where('id',$id)->delete();
if ($result){
$this->success('操作成功');
}else{
$this->error('操作失败');
}
}
/**
* 问题详情
*/
public function questioninfo(){
... ...
... ... @@ -129,6 +129,7 @@
<if condition="$vo['status'] eq 1 or $vo['status'] eq 3 ">
<font style="color: blue" onclick="doSelectCategory({$vo['id']})" href="{:url('activity/joinTime',array('id'=>$vo['id']))}">参加活动时间</font>
<font style="" onclick="userWork({$vo['id']})" href="{:url('activity/userWork',array('id'=>$vo['id']))}">查看工作汇报</font>
<a style="" href="{:url('clock/addclock',array('id'=>$vo['id']))}">添加打卡信息</a>
</if>
<else />
... ...
... ... @@ -9,12 +9,12 @@
<!--</li>-->
</ul>
<!-- <form class="well form-inline margin-top-20" method="post" action="{:url('activity/index')}">
<form class="well form-inline margin-top-20" method="post" action="{:url('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>-->
<a class="btn btn-danger" href="{:url('index')}">清空</a>
</form>
<form class="js-ajax-form" action="" method="post">
<table class="table table-hover table-bordered">
<thead>
... ... @@ -31,7 +31,6 @@
<tbody>
<foreach name="data" item="vo">
<tr>
<td>{$vo.id}</td>
<td>{$vo.activity_name}</td>
<td>{$vo.user_name}</td>
... ...
... ... @@ -48,8 +48,11 @@
<td>{$vo.id}</td>
<td>{$vo.title}</td>
<td>
<a href='{:url("questionInfo",array("id"=>$vo["id"]))}'>查看详情</a>
<a href='{:url("questionInfo",array("id"=>$vo["id"]))}'>查看详情</a>|
<a class="js-ajax-dialog-btn" data-msg="确定删除吗?" href="{:url('delete',array('id'=>$vo['id']))}">删除</a>
</td>
</tr>
</foreach>
... ...
... ... @@ -22,52 +22,9 @@
min-height:767px;
}
</style>
<script charset="utf-8" src="http://map.qq.com/api/js?v=2.exp"></script>
<script>
var markersArray=[];
var init = function() {
var map = new qq.maps.Map(document.getElementById("container"),{
center: new qq.maps.LatLng(39.916527,116.397128),
zoom: 13,
});
//添加监听事件
qq.maps.event.addListener(map, 'click', function(data) {
for (i in markersArray) {
markersArray[i].setMap(null);
}
var anchor = new qq.maps.Point(6, 6),
size = new qq.maps.Size(24, 24),
origin = new qq.maps.Point(0, 0),
marker = new qq.maps.Marker({
map: map,
position:data.latLng});
markersArray.push(marker);
console.log(data);
document.getElementById('pointInput').value=data.latLng;
setTimeout(function(){
// alert(data.latLng);
},200);
});
}
function confirmSelect(){
var selectLocation = {};
var gpsAddr = document.getElementById('currentAddr');
var location = document.getElementById('pointInput');
/* selectLocation.gpsAddr = gpsAddr.innerHTML;*/
selectLocation.location = location.value;
console.log(selectLocation.location);
window.opener.SelectLocation.selectCallback(selectLocation);
window.close();
}
</script>
</head>
<body onload="init()">
<body onload="">
<div class="LogoCon clear" style="font-size:18px;">
<div style="display:block">
... ... @@ -78,5 +35,136 @@
</div>
</div>
<div id="container"></div>
<!--<div id="searchPart">-->
<!--<input type="text" id="searchInput" placeholder="请输入">-->
<!--<button id="searchBtn">搜索</button>-->
<!--</div>-->
</body>
<script src="https://map.qq.com/api/gljs?v=1.exp&key=OB4BZ-D4W3U-B7VVO-4PJWW-6TKDJ-WPB77"></script>
<!--<script charset="utf-8" src="http://map.qq.com/api/js?v=2.exp"></script>-->
<script>
// var markersArray=[];
// var init = function() {
// var map = new qq.maps.Map(document.getElementById("container"),{
// center: new qq.maps.LatLng(39.916527,116.397128),
// zoom: 13,
// });
// //添加监听事件
// qq.maps.event.addListener(map, 'click', function(data) {
//
// for (i in markersArray) {
// markersArray[i].setMap(null);
// }
//
// var anchor = new qq.maps.Point(6, 6),
// size = new qq.maps.Size(24, 24),
// origin = new qq.maps.Point(0, 0),
// marker = new qq.maps.Marker({
// map: map,
// position:data.latLng});
// markersArray.push(marker);
// console.log(data);
// document.getElementById('pointInput').value=data.latLng;
// setTimeout(function(){
// // alert(data.latLng);
// },200);
//
//
// });
// }
var map, marker, infoWindow;
// 创建信息窗口
var center = new TMap.LatLng(39.984104, 116.307503);//设置中心点坐标
//初始化地图
var map = new TMap.Map("container", {
center: center
});
//初始化marker图层
var markerLayer = new TMap.MultiMarker({
id: 'marker-layer',
map: map
});
//监听点击事件添加marker
map.on("click", (evt) => {
console.log(evt.latLng);
document.getElementById('pointInput').value=evt.latLng
});
function searchClick() {
let searchInput = document.getElementById('searchInput').value; // 获取搜索内容
let url = [
'https://apis.map.qq.com/ws/place/v1/search',
'?boundary=nearby(39.984104,116.307503,1000,0)',
`&keyword=${searchInput}`,
'&page_size=10&page_index=1&orderby=_distance',
'&output=jsonp&callback=cb',
'&key=OB4BZ-D4W3U-B7VVO-4PJWW-6TKDJ-WPB77'
].join('');
jsonp_request(url);
infoWindow.close(); // 关闭信息窗口
}
// 添加搜索按钮点击事件
const searchBtn = document.getElementById('searchBtn');
searchBtn.addEventListener('click', searchClick, false);
function jsonp_request(url) {
let script = document.createElement('script');
script.src = url;
document.body.appendChild(script);
}
function confirmSelect(){
var selectLocation = {};
var gpsAddr = document.getElementById('currentAddr');
var location = document.getElementById('pointInput');
/* selectLocation.gpsAddr = gpsAddr.innerHTML;*/
selectLocation.location = location.value;
console.log(selectLocation.location);
window.opener.SelectLocation.selectCallback(selectLocation);
window.close();
}
function cb(ret) {
let newBounds = new TMap.LatLngBounds();
let markerArr = [];
if(ret && ret.status===0 && ret.data.length>0) {
// 将搜索结果保存进数组中
ret.data.forEach( (item, index) => {
let position = new TMap.LatLng(item.location.lat, item.location.lng);
markerArr.push({
position: position,
properties: {
title: item.title,
address: item.address,
tel: item.tel!==' ' ? item.tel : '暂无'
}
});
// 寻找搜索结果的边界
newBounds.extend(position);
});
// 更新marker层,显示标记
marker.setGeometries(markerArr);
// 地图自适应边界
map.fitBounds(newBounds, {
padding: 100 // 边界与内容之间留的间距
});
}
}
</script>
</html>
\ No newline at end of file
... ...