Commit 3cb3b19f authored by hezhen's avatar hezhen

修改商品详情

parent d1114524
......@@ -41,6 +41,10 @@ function changeWater($id)
}
}
function result($tyep,$msg,$data){
exit(json_encode(array('errno'=>$tyep,'message'=>$msg,'data'=>$data)));
}
function checkFreeCard($order_id){
$order_goods_list = pdo_getall('longbing_company_shop_order_item',array('order_id'=>$order_id));
$return = false;
......@@ -59,21 +63,20 @@ is_file(ROOT_PATH . '/inc/we7.php') || exit('Access Denied Longbing');
require_once ROOT_PATH . '/inc/we7.php';
global $_GPC;
global $_W;
$uid = $_GPC['user_id'];
$id = $_GPC['id'];
if (!$uid || !$id) {
return $this->result(-1, '', array());
if ( !$id) {
result(-1, '', array());
}
$where = array('user_id' => $uid, 'id' => $id);
$where = array( 'id' => $id);
$info = pdo_get('longbing_company_shop_order', $where);
if (!$info) {
return $this->result(-1, '', array());
result(-1, '', array());
}
if ($info['order_status'] != 2) {
return $this->result(-1, '', array());
$uid=$info['user_id'];
if ($info['pay_status'] != 1) {
result(-1, '', array());
}
$uniacid = $info['uniacid'];
$result = pdo_update('longbing_company_shop_order', array('order_status' => 3), $where);
......@@ -91,9 +94,9 @@ if ($result) {
/*if(checkFreeCard($id)){
pdo_update('longbing_company_user', array('is_pay' => 1,'is_staff'=>1), array('id' => $uid));
}*/
return $this->result(0, '', array());
result(0, '', array());
}
return $this->result(-1, '', array());
result(-1, '', array());
?>
......@@ -123,7 +123,7 @@ function curlPostTmp($url, $data)
}
function getCompanys($good_id){
$sql="SELECT c.id,c.name FROM".tablename('longbing_company_company')." c LEFT JOIN ".tablename('longbing_company_goods_company')." g
$sql="SELECT c.id,c.short_name FROM".tablename('longbing_company_company')." c LEFT JOIN ".tablename('longbing_company_goods_company')." g
ON c.id=g.company_id WHERE g.good_id=$good_id and g.isdel=0 and c.status=1";
$list=pdo_fetchall($sql);
return $list;
......
......@@ -115,6 +115,29 @@
<script src="../../../addons/{$module_name}/images/layuiadmin/layui/layui.js"></script>
<script src="../../../addons/{$module_name}/images/js/jquery.min.js"></script>
<script>
function ajaxFun(e,fun){
var json_mun=false;
$.ajax({
type : "post",
url : e.url,
data : e.json,
async:false,
dataType : "json",
success : function(resp){
json_mun=resp;
if(fun){
fun(json_mun);
return false;
}
},error:function(){
if(fun){
fun(json_mun)
return false;
}
}
});
}
layui.use(['layer', 'laypage'], function () {
var layer = layui.layer
, laypage = layui.laypage;
......@@ -148,19 +171,40 @@
return false;
}
$("input[name='itemId']").val(id);
layer.open({
type: 1,
title: false,
closeBtn: 0,
shadeClose: true,
skin: 'yourClass',
content: '<div style="padding: 20px; width: 260px; height: 210px;">' +
'<input type="text" autocomplete="off" class="layui-input" value="" id="courier_number" placeholder="请输入快递单号">' +
'<input type="text" autocomplete="off" class="layui-input" value="" id="express_company" placeholder="请输入快递公司" style="margin-top: 10px">' +
'<input type="text" autocomplete="off" class="layui-input" value="" id="express_phone" placeholder="请输入快递查询电话" style="margin-top: 10px">' +
'<button class="layui-btn" required lay-verify="required" style="margin-top: 30px" onclick="btnSub()">立即提交</button>' +
'</div>'
layer.confirm('是否审核通过?', {
btn: ['通过','取消'] //按钮
}, function(){
ajaxFun({
url:"{php echo $this->createWebUrl('manage/shopendorder')}",
json:{id:id}
},function(e){
if(e){
if(e.errno==0){
layer.msg("审核成功!");
}else{
layer.msg("审核失败!");
}
//e是后台返回的数据;这里是成功的意思
}else{
layer.msg("网络失败,请稍后再试!");
}
})
}, function(){
//取消调这里
});
// layer.open({
// type: 1,
// title: false,
// closeBtn: 0,
// shadeClose: true,
// skin: 'yourClass',
// content: '<div style="padding: 20px; width: 260px; height: 210px;">' +
// '<input type="text" autocomplete="off" class="layui-input" value="" id="courier_number" placeholder="请输入快递单号">' +
// '<input type="text" autocomplete="off" class="layui-input" value="" id="express_company" placeholder="请输入快递公司" style="margin-top: 10px">' +
// '<input type="text" autocomplete="off" class="layui-input" value="" id="express_phone" placeholder="请输入快递查询电话" style="margin-top: 10px">' +
// '<button class="layui-btn" required lay-verify="required" style="margin-top: 30px" onclick="btnSub()">立即提交</button>' +
// '</div>'
// });
});
// 提交
......
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