作者 王晓刚
1 个管道 的构建 通过 耗费 11 秒

修改问题文档

... ... @@ -19,6 +19,12 @@
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('关键字')}:</label>
<div class="col-xs-12 col-sm-8">
<textarea id="c-keyword" class="form-control" name="row[keyword]">{$row.keyword|htmlentities}</textarea>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Thumbnail')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group">
... ...
... ... @@ -21,15 +21,21 @@
</div>
{else /}
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Goodstype_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-goodstype_id" data-rule="required" data-source="goodstype/selectpage" data-params='{"custom[pid]":["gt","0"]}' class="form-control selectpage" name="row[goodstype_id]" type="text" value="{$row.goodstype_id|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Goodsname')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-goodsname" data-rule="required" class="form-control" name="row[goodsname]" type="text" value="{$row.goodsname|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Goodstype_id')}:</label>
<label class="control-label col-xs-12 col-sm-2">{:__('关键字')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-goodstype_id" data-rule="required" data-source="goodstype/selectpage" data-params='{"custom[pid]":["gt","0"]}' class="form-control selectpage" name="row[goodstype_id]" type="text" value="{$row.goodstype_id|htmlentities}">
<textarea id="c-keyword" class="form-control" name="row[keyword]">{$row.keyword|htmlentities}</textarea>
</div>
</div>
<div class="form-group">
... ...
... ... @@ -16,6 +16,7 @@ use app\index\model\Goodstype;
use app\index\model\Pic;
use app\index\model\Province;
use app\index\model\Store;
use think\Db;
class Goods extends Frontend
{
... ... @@ -192,7 +193,7 @@ class Goods extends Frontend
$where['g.is_clearance'] = ['eq',$param['is_clearance']];
}
if(!empty($param['keyword'])){
$where['t.name|s.name|g.goodsname|g.brand'] = ['like',"%$param[keyword]%"];
$where['t.name|s.name|g.goodsname|g.brand|g.keyword'] = ['like',"%$param[keyword]%"];
}
if(!empty($param['category_id'])){
$where['g.goodstype_id'] = ['eq',$param['category_id']];
... ... @@ -275,7 +276,12 @@ class Goods extends Frontend
}
$storeModel = new Store();
$evaluateModel = new Evaluate();
//店铺id
$store_ids = [];
foreach($data as $key => $vo){
if(!in_array($vo['store_id'],$store_ids)){
$store_ids[] = $vo['store_id'];
}
//判断店铺在该区域是否为会员
$insurance = '2';
$store = $storeModel->findData(['id'=>$vo['store_id']]);
... ... @@ -309,7 +315,8 @@ class Goods extends Frontend
array_multisort($sort,SORT_DESC,$data->items());
}
}
$this->success('SUCCESS','',$data);
$store = Db::name('store')->where(['id'=>['in',$store_ids]])->select();
$this->success('SUCCESS','',$data,$store);
}
public function get_one(){
$param = $this->request->param();
... ...
... ... @@ -667,6 +667,9 @@
var geoc;
var locationLng = 117.233;
var locationLat = 36.11365;
var mapObj = new BMap.Map("allmap");
var point = new BMap.Point(112.331398,39.897445);
mapObj.centerAndZoom(point,10);
$(function () {
// showTableData();
// initMap();
... ... @@ -772,13 +775,18 @@
" <td>"+vo.store_address+""+distance+"</td>\n" +
" </tr>";
goods_html += str.replace("GOODS_ID",vo.id).replace("STORE_ID",vo.store_id);
console.log(goods_html);
});
$('.goods_dom').html(goods_html);
$('#resultsNum').html(res.data.total+"件");
//初始化分页
var totalPage = Math.ceil(res.data.total/pageNum);
initPaging(res.data.total,res.data.current_page,totalPage,pageNum);
// 随机向地图添加25个标注
$(res.wait).each(function (key, w) {
var point = new BMap.Point(w.lng, w.lat);
// console.log(point);
addMarker2(point);
});
},
error:function(res){
toast('与服务器断开连接');
... ... @@ -979,7 +987,7 @@
})
}
//添加标注点
//添加标注中心
function addMarker(point, index){ // 创建图标对象
var myIcon = new BMap.Icon("__CDN__/assets/store/images/mapPoint_icon.png", new BMap.Size(50, 50), {});
// 创建标注对象并添加到地图
... ... @@ -1002,11 +1010,19 @@
mapObj.addOverlay(circle);
if (point != null) {
circle.addEventListener("lineupdate", function (e) {
console.log(circle.getRadius()); //返回圆形覆盖物的半径
circle.getRadius(); //返回圆形覆盖物的半径
});
}
initGoodsList();
}
//添加标注点
function addMarker2(point){
console.log(point);
var marker = new BMap.Marker(point);
console.log(marker);
mapObj.addOverlay(marker);
}
</script>
</body>
</html>
\ No newline at end of file
... ...