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

提交信息

... ... @@ -13,21 +13,20 @@ class GoodsModel extends Model
public function getGoods($id){
$map['id']=$id;
$map['is_online']=1;
$info=$this->where($map)->find();
$info=$this->where($map)->find()->toArray();
if(empty($info)){
return '';
}
$info['pic']=cmf_get_image_url($info['pic']);
//is_json($info['banner']);
$info['banner']=json_decode($info['banner'],true);
//dump($info['banner']);
// if (!empty($info['banner']) && is_array($info['banner'])){
// foreach ($info['banner'] as $k=>$v) {
// $info['banner'][$k]=cmf_get_image_url($v);
// }
// }else{
// $info['banner']=[];
// }
if (!empty($info['banner']) && is_array($info['banner'])){
foreach ($info['banner'] as $k=>$v) {
$info['banner'][$k]=cmf_get_image_url($v);
}
}else{
$info['banner']=[];
}
return $info;
}
... ...
... ... @@ -39,9 +39,6 @@ class GoodController extends AdminBaseController
$data=db('goods')->where('id',$id)->find();
$data['banner']=json_decode($data['banner']);
$data['banner_name']=json_decode($data['banner_name']);
foreach ($data['banner'] as $k=>$v){
$data['banner'][$k]=cmf_get_image_url($v);
}
$this->assign('data',$data);
return $this->fetch();
}
... ...
<include file="public@header"/>
</head>
<body>
<!--<script type="text/html" id="photos-item-tpl">-->
<!--<li id="saved-image{id}">-->
<!--<input id="photo-{id}" type="hidden" name="photo_urls[]" value="{filepath}">-->
<!--<input class="form-control" id="photo-{id}-name" type="text" name="photo_names[]" value="{name}"-->
<!--style="width: 200px;" title="图片名称">-->
<!--<img id="photo-{id}-preview" src="{url}" style="height:36px;width: 36px;"-->
<!--onclick="imagePreviewDialog(this.src);">-->
<!--<a href="javascript:uploadOneImage('图片上传','#photo-{id}');">替换</a>-->
<!--<a href="javascript:(function(){$('#saved-image{id}').remove();})();">移除</a>-->
<!--</li>-->
<!--</script>-->
<script type="text/html" id="photos-item-tpl">
<li id="saved-image{id}">
<input id="photo-{id}" type="hidden" name="banner[]" value="{filepath}">
<input class="form-control" id="photo-{id}-name" type="text" name="banner_name[]" value="{name}"
style="width: 200px;" title="图片名称">
<img id="photo-{id}-preview" src="{url}" style="height:36px;width: 36px;"
onclick="imagePreviewDialog(this.src);">
<a href="javascript:uploadOneImage('图片上传','#photo-{id}');">替换</a>
<a href="javascript:(function(){$('#saved-image{id}').remove();})();">移除</a>
</li>
</script>
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li><a href="{:url('index')}">商品列表</a></li>
... ...