Commit a422017e authored by hezhen's avatar hezhen

修改商品会员

parent 989587f8
...@@ -164,8 +164,10 @@ if (isset($_GPC['id'])) { ...@@ -164,8 +164,10 @@ if (isset($_GPC['id'])) {
if ($info['images']) { if ($info['images']) {
$info['images'] = explode(',', $info['images']); $info['images'] = explode(',', $info['images']);
} }
$start_time=array();
if ($info['start_time']) {
$start_time = json_decode($info['start_time'],true);
}
} }
......
...@@ -151,7 +151,7 @@ if (!$to_uid) { ...@@ -151,7 +151,7 @@ if (!$to_uid) {
$u = pdo_get('longbing_company_user',array("id"=>$uid)); $u = pdo_get('longbing_company_user',array("id"=>$uid));
$level = $u['level_id']; $level = $u['level_id'];
$goods = pdo_get('longbing_company_goods', array('id' => $goods_id), array('id', 'name', 'cover', 'images', 'price', 'view_count', 'sale_count', 'desc', 'content', 'collage_count', 'is_collage', 'freight', 'recommend', 'stock', 'image_url', 'unit','start_time','end_time','is_free_card','is_discount','leve_id','is_make')); $goods = pdo_get('longbing_company_goods', array('id' => $goods_id), array('id', 'name', 'cover', 'images', 'price', 'view_count', 'sale_count', 'desc', 'content', 'collage_count', 'is_collage', 'freight', 'recommend', 'stock', 'image_url', 'unit','start_time','end_time','is_free_card','is_discount','leve_id','is_make','explain'));
$goods_price = $goods['price']; $goods_price = $goods['price'];
$goods_stock = $goods['stock']; $goods_stock = $goods['stock'];
$is_discount=$goods['is_discount']; $is_discount=$goods['is_discount'];
...@@ -179,6 +179,7 @@ if($level>0){ ...@@ -179,6 +179,7 @@ if($level>0){
$goods['content'] = $this->toWXml($goods['content']); $goods['content'] = $this->toWXml($goods['content']);
$goods['explain'] = $this->toWXml($goods['explain']);
$spe = pdo_getall('longbing_company_shop_spe', array('goods_id' => $goods_id, 'status' => 1, 'uniacid' => $uniacid), array('id', 'title', 'pid')); $spe = pdo_getall('longbing_company_shop_spe', array('goods_id' => $goods_id, 'status' => 1, 'uniacid' => $uniacid), array('id', 'title', 'pid'));
$speList = array(); $speList = array();
...@@ -197,18 +198,20 @@ if($level>0){ ...@@ -197,18 +198,20 @@ if($level>0){
} }
} }
} }
if($goods['start_time']){
$goods['start_time']=json_decode($goods['start_time']); $goods['start_time']=json_decode($goods['start_time'],true);
}
$goods['companyList']=getCompanys($goods['id']); $goods['companyList']=getCompanys($goods['id']);
$goods['spe_list'] = $speList; $goods['spe_list'] = $speList;
$spe_price = pdo_getall('longbing_company_shop_spe_price', array('goods_id' => $goods_id, 'status' => 1, 'uniacid' => $uniacid), array('id', 'spe_id_1', 'price', 'stock')); $spe_price = pdo_getall('longbing_company_shop_spe_price', array('goods_id' => $goods_id, 'status' => 1, 'uniacid' => $uniacid), array('id', 'spe_id_1', 'price', 'stock'));
$goods['spe_price'] = $spe_price;
$ids = ''; $ids = '';
foreach ($spe_price as $k => $v) { foreach ($spe_price as $k => $v) {
$ids .= ',' . $v['id']; $ids .= ',' . $v['id'];
} $price1 = $v['price']*$level_discount/100;
$spe_price[$k]['m_price']= sprintf('%.2f',$price1);
}
$goods['spe_price'] = $spe_price;
// foreach ($goods as $c => $g){ // foreach ($goods as $c => $g){
// $goods[$c]['to_uid']=$to_uid; // $goods[$c]['to_uid']=$to_uid;
// //
...@@ -354,6 +357,7 @@ if($level>0){ ...@@ -354,6 +357,7 @@ if($level>0){
} }
$goods['content'] = $this->toWXml($goods['content']); $goods['content'] = $this->toWXml($goods['content']);
$goods['explain'] = $this->toWXml($goods['explain']);
$spe = pdo_getall('longbing_company_shop_spe', array('goods_id' => $goods_id, 'status' => 1, 'uniacid' => $uniacid), array('id', 'title', 'pid')); $spe = pdo_getall('longbing_company_shop_spe', array('goods_id' => $goods_id, 'status' => 1, 'uniacid' => $uniacid), array('id', 'title', 'pid'));
$speList = array(); $speList = array();
...@@ -522,6 +526,7 @@ if($level>0){ ...@@ -522,6 +526,7 @@ if($level>0){
} }
$goods['content'] = $this->toWXml($goods['content']); $goods['content'] = $this->toWXml($goods['content']);
$goods['explain'] = $this->toWXml($goods['explain']);
$spe = pdo_getall('longbing_company_shop_spe', array('goods_id' => $goods_id, 'status' => 1, 'uniacid' => $uniacid), array('id', 'title', 'pid')); $spe = pdo_getall('longbing_company_shop_spe', array('goods_id' => $goods_id, 'status' => 1, 'uniacid' => $uniacid), array('id', 'title', 'pid'));
$speList = array(); $speList = array();
......
...@@ -330,6 +330,9 @@ ...@@ -330,6 +330,9 @@
<div class="layui-inline" style="float: left"> <div class="layui-inline" style="float: left">
<label class="layui-form-label">出发时间:</label> <label class="layui-form-label">出发时间:</label>
<div class="layui-input-inline add" id="timeList"> <div class="layui-input-inline add" id="timeList">
{loop $start_time['sites'] $index $item}
<input type="date" name='start_time{$index}' value="{$item['time']}" class="layui-input" placeholder="年-月-日" />
{/loop}
</div> </div>
<div style="clear: both;padding-top: 15px;"><button class="layui-btn" onclick="dayHtml();return false;">+添加</button></div> <div style="clear: both;padding-top: 15px;"><button class="layui-btn" onclick="dayHtml();return false;">+添加</button></div>
...@@ -437,6 +440,12 @@ ...@@ -437,6 +440,12 @@
{php echo tpl_ueditor('content', $info['content']);} {php echo tpl_ueditor('content', $info['content']);}
</div> </div>
</div> </div>
<div class="layui-form-item">
<label class="layui-form-label">预定须知</label>
<div class="layui-input-block">
{php echo tpl_ueditor('explain', $info['explain']);}
</div>
</div>
<div class="layui-form-item"> <div class="layui-form-item">
<div class="layui-input-block"> <div class="layui-input-block">
...@@ -446,7 +455,8 @@ ...@@ -446,7 +455,8 @@
</div> </div>
</div> </div>
</div>
</div>
</form> </form>
...@@ -459,7 +469,7 @@ ...@@ -459,7 +469,7 @@
<script src="../../../addons/{$module_name}/images/layuiadmin/layui/layui.js"></script> <script src="../../../addons/{$module_name}/images/layuiadmin/layui/layui.js"></script>
<script> <script>
function dayHtml(){ function dayHtml(){
let count = $("input[name^='start_time']").size() + 1; let count = $("input[name^='start_time']").size();
let names = "start_time"+count; let names = "start_time"+count;
var html = ""; var html = "";
html+='<input type="date" name="'+names+'" class="layui-input" placeholder="年-月-日" />'; html+='<input type="date" name="'+names+'" class="layui-input" placeholder="年-月-日" />';
...@@ -494,9 +504,8 @@ ...@@ -494,9 +504,8 @@
return "0"+e; return "0"+e;
} }
} }
function timesFun(){ function timesFun(){debugger
var start_time = "{$info['start_time']}"; var start_time = {$start_time};
// var end_time = "{$info['end_time']}";
if(start_time){ if(start_time){
var d = new Date(start_time*1000); var d = new Date(start_time*1000);
var n = d.getFullYear();//年 var n = d.getFullYear();//年
...@@ -521,7 +530,7 @@ ...@@ -521,7 +530,7 @@
}); });
$(function(){ $(function(){
getSheng(); getSheng();
timesFun(); // timesFun();
dayHtml(); dayHtml();
}) })
form.on('select(province)', function(data){ form.on('select(province)', function(data){
...@@ -548,15 +557,15 @@ ...@@ -548,15 +557,15 @@
} }
} }
layer.load();debugger layer.load();
let count = $("input[name^='start_time']").size(); let count = $("input[name^='start_time']").size();
let sites = []; let sites = [];
for(let i = 1; i<= count; i++) { for(let i = 0; i< count; i++) {
let n = "start_time" + i let n = "start_time" + i
let t = { let t = {
time: formData[n] time: formData[n]
}; };
sites.push(t); if(t.time){sites.push(t);}
delete formData[n]; delete formData[n];
} }
// if(formData.start_time){ // if(formData.start_time){
...@@ -574,7 +583,8 @@ ...@@ -574,7 +583,8 @@
if (id > 0) { if (id > 0) {
data.id = id; data.id = id;
} }
data.start_time=formData.start_time; data.start_time= {sites:sites}
;
postData(url, data); postData(url, data);
return false; return false;
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment