Commit c05952b2 by 冷斌

update

parent a5eb8753
......@@ -56,13 +56,20 @@ class AuditController extends AdminController
$data['status']=$status;
$msg=$approve->where('id='.$_GET['id'])->save($data);
if($msg){
$u_id=$approve->where('id='.$_GET['id'])->field('u_id')->find();
$u_id=$approve->where('id='.$_GET['id'])->field('u_id, business_license')->find();
$user=M('user');
if($data['status']==1){
$u_data['is_shop']=1;
if (!empty($u_id['business_license'])) {
$u_data['is_vip']=1;
}
}else{
if (!empty($u_id['business_license'])) {
$u_data['is_vip']=0;
} else {
$u_data['is_shop']=0;
}
}
$user->where('id='.$u_id['u_id'])->data($u_data)->save();
}
}
......@@ -73,13 +80,16 @@ class AuditController extends AdminController
if(!isset($_GET['id'])){header('location:'.U('Audit/index'));die;}
$approve=M('approve');
$rows=$approve->where('yi_approve.id='.$_GET['id'])
->field('yi_approve.id,head_img,u_name,tel,reg_time,is_shop,shop_name,s_name,s_tel,s_sex,s_eg,a1.name province_name,a2.name city_name,a3.name county_name,detail,shop_img,yi_approve.status,time')
->field('yi_approve.id,head_img,u_name,tel,reg_time,is_shop,shop_name,s_name,s_tel,s_sex,s_eg,a1.name province_name,a2.name city_name,a3.name county_name,detail,shop_img,yi_approve.status,time,business_license,contract')
->join('yi_area a1 on yi_approve.province=a1.id')
->join('yi_area a2 on yi_approve.city=a2.id')
->join('yi_area a3 on yi_approve.county=a3.id')
->join('yi_user on yi_approve.u_id=yi_user.id')
->find();
$rows['is_vip'] = !empty( $rows['business_license']) ? 1 : 0;
$rows['shop_img']=get_picture_list($rows['shop_img'],'abs');
$rows['business_license'] = get_picture_list($rows['business_license'],'abs');
$rows['contract'] = get_picture_list($rows['contract'],'abs');
$this->meta_title='资料详情';
$this->assign('rows',$rows);
$this->display();
......
......@@ -63,6 +63,7 @@ class CarouselController extends AdminController
}else{
$this->error($rows['type'].'修改失败!请稍后在试!');
}
S('CarouselZt_list',null,-1);
}
}
//删除轮播
......
......@@ -412,7 +412,7 @@ class GroupOrderController extends AdminController
$user_info=$order->where($where)->field('uid,u_name,u_tel')->find();
$uid=$user_info['uid'];
$title='发货提醒';
$content='尊敬的'.$user_info['u_name'].'(先生/女士)您好,易和仓淘已经收到订单号为('.$_POST['order_num'].')订单信息,平台将尽快安排发货,并按照订单信息进行服务,感谢您的对易和仓淘的支持,谢谢!';
$content='尊敬的'.$user_info['u_name'].'(先生/女士)您好,宅家有购已经收到订单号为('.$_POST['order_num'].')订单信息,平台将尽快安排发货,并按照订单信息进行服务,感谢您的对易和仓淘的支持,谢谢!';
addAdv($uid,$title,$content);//发送平台消息
$tel=$user_info['u_tel'];
//发送订单短信
......@@ -446,7 +446,7 @@ class GroupOrderController extends AdminController
$user_info=$order->where('id='.$_POST['order_id'])->field('uid,u_name,u_tel')->find();
$uid=$user_info['uid'];
$title='收货提醒';
$content='尊敬的'.$user_info['u_name'].'(先生/女士)您好,您订单号为('.$_POST['order_num'].')的订单,已经完成交易,感谢您的对易和仓淘的支持,谢谢!';
$content='尊敬的'.$user_info['u_name'].'(先生/女士)您好,您订单号为('.$_POST['order_num'].')的订单,已经完成交易,感谢您的对宅家有购的支持,谢谢!';
addAdv($uid,$title,$content);//发送平台消息
}
$this->success('状态修改成功!',U('GroupOrder/index2'),2);
......
......@@ -411,7 +411,7 @@ class GroupOrderController extends AdminController
$user_info=$order->where($where)->field('uid,u_name,u_tel')->find();
$uid=$user_info['uid'];
$title='发货提醒';
$content='尊敬的'.$user_info['u_name'].'(先生/女士)您好,易和仓淘已经收到订单号为('.$_POST['order_num'].')订单信息,平台将尽快安排发货,并按照订单信息进行服务,感谢您的对易和仓淘的支持,谢谢!';
$content='尊敬的'.$user_info['u_name'].'(先生/女士)您好,宅家有购已经收到订单号为('.$_POST['order_num'].')订单信息,平台将尽快安排发货,并按照订单信息进行服务,感谢您的对易和仓淘的支持,谢谢!';
addAdv($uid,$title,$content);//发送平台消息
$tel=$user_info['u_tel'];
//发送订单短信
......@@ -445,7 +445,7 @@ class GroupOrderController extends AdminController
$user_info=$order->where('id='.$_POST['order_id'])->field('uid,u_name,u_tel')->find();
$uid=$user_info['uid'];
$title='收货提醒';
$content='尊敬的'.$user_info['u_name'].'(先生/女士)您好,您订单号为('.$_POST['order_num'].')的订单,已经完成交易,感谢您的对易和仓淘的支持,谢谢!';
$content='尊敬的'.$user_info['u_name'].'(先生/女士)您好,您订单号为('.$_POST['order_num'].')的订单,已经完成交易,感谢您的对宅家有购的支持,谢谢!';
addAdv($uid,$title,$content);//发送平台消息
}
$this->success('状态修改成功!',U('GroupOrder/index2'),2);
......
......@@ -43,7 +43,7 @@ class InveController extends AdminController
->join('yi_goods_group gg on yi_goods.id=gg.goods_id')
->select();
$order_info[$key]['o_status']=$goods_info[0]['status'];
$order_info[$key]['goods']=$goods_info;
$order_info[$key]['goods']=[$goods_info[0]];
$order_info[$key]['s_price']=0;
foreach($goods_info as $v1){
$order_info[$key]['s_price']+=$v1['s_price'];
......@@ -221,7 +221,7 @@ class InveController extends AdminController
$user_info=$order->where($where)->field('uid,u_name,u_tel')->find();
$uid=$user_info['uid'];
$title='发货提醒';
$content='尊敬的'.$user_info['u_name'].'(先生/女士)您好,易和仓淘已经收到订单号为('.$_POST['order_num'].')订单信息,平台将尽快安排发货,并按照订单信息进行服务,感谢您的对易和仓淘的支持,谢谢!';
$content='尊敬的'.$user_info['u_name'].'(先生/女士)您好,宅家有购已经收到订单号为('.$_POST['order_num'].')订单信息,平台将尽快安排发货,并按照订单信息进行服务,感谢您的对易和仓淘的支持,谢谢!';
addAdv($uid,$title,$content);//发送平台消息
$tel=$user_info['u_tel'];
addSms($tel,$content);
......@@ -245,7 +245,7 @@ class InveController extends AdminController
$user_info=$order->where('id='.$_POST['order_id'])->field('uid,u_name,u_tel')->find();
$uid=$user_info['uid'];
$title='收货提醒';
$content='尊敬的'.$user_info['u_name'].'(先生/女士)您好,您订单号为('.$_POST['order_num'].')的订单,已经完成交易,感谢您的对易和仓淘的支持,谢谢!';
$content='尊敬的'.$user_info['u_name'].'(先生/女士)您好,您订单号为('.$_POST['order_num'].')的订单,已经完成交易,感谢您的对宅家有购的支持,谢谢!';
addAdv($uid,$title,$content);//发送平台消息
}
$this->success('状态修改成功!',U('GroupOrder/index2'),2);
......
......@@ -16,6 +16,7 @@
<p style="font-size: 18px;font-weight: 600;">会员类型:
<eq name="rows.is_shop" value="0">普通会员</eq>
<eq name="rows.is_shop" value="1">认证会员</eq>
<eq name="rows.is_vip" value="1"><span style="color: red;"> - VIP </span></eq>
</p>
<hr/>
<p>店铺名称:{$rows.shop_name}</p>
......@@ -35,6 +36,16 @@
<img src="{$vo.path}" alt="" width="500" height="220" style="border: 2px grey solid;padding: 2px;margin: 5px;">
</volist>
</p>
<p>营业执照:<br/>
<volist name="rows.business_license" id="vo">
<img src="{$vo.path}" alt="" width="500" height="220" style="border: 2px grey solid;padding: 2px;margin: 5px;">
</volist>
</p>
<p>签订合同首页:<br/>
<volist name="rows.contract" id="vo">
<img src="{$vo.path}" alt="" width="500" height="220" style="border: 2px grey solid;padding: 2px;margin: 5px;">
</volist>
</p>
</div>
<a href="{:U('Audit/changeS?id='.$rows['id'].'&status=1')}" class="btn">通过</a>
<a href="{:U('Audit/changeS?id='.$rows['id'].'&status=2')}" class="btn">不通过</a>
......
......@@ -61,6 +61,13 @@
<!--<empty name="auth_group.detail">-->
<!-- </empty>-->
<div class="form-item">
<label for="auth-description" class="item-label">是否指定vip发货</label>
<div class="controls">
<input type="radio" name="is_vip" <?php if($auth_group['is_vip']=='0'){ echo 'checked';} ?> value=0 /> 否
<input type="radio" name="is_vip" <?php if($auth_group['is_vip']=='1'){ echo 'checked';} ?> value=1 />是
</div>
</div>
<div class="form-item">
<label for="auth-description" class="item-label">描述</label>
<div class="controls">
<label class="textarea input-large"><textarea id="auth-description" type="text" name="description">{$auth_group.description}</textarea></label>
......
......@@ -72,7 +72,7 @@
规格:{$v.stan|default="无"}
</div>
<div>
配送方式:<eq name="rows.type" value="1">全配送</eq><eq name="rows.type" value="2">库存购</eq><br/>
配送方式:<eq name="rows.type" value="1">立即购买</eq><eq name="rows.type" value="2">库存购</eq><br/>
支付方式:<eq name="rows.pay_type" value="1">支付宝支付</eq><eq name="rows.pay_type" value="2">货到付款</eq><eq name="rows.pay_type" value="3">微信支付</eq><br/>
所属分仓:{$v.title}
</div>
......@@ -145,7 +145,7 @@
支付方式:<eq name="rows.pay_type" value="1">支付宝</eq><eq name="rows.pay_type" value="2">货到付款</eq>
</span>
<span style="margin-left: 20px;">
配送方式:<eq name="rows.type" value="1">全配送</eq><eq name="rows.type" value="2">库存购</eq>
配送方式:<eq name="rows.type" value="1">立即购买</eq><eq name="rows.type" value="2">库存购</eq>
</span><br/>
<span>订单状态:
<eq name="rows.status1" value="1">待付款</eq>
......
......@@ -2,7 +2,7 @@
<html>
<head>
<meta charset="UTF-8">
<title>{$meta_title}|易和仓淘管理平台</title>
<title>{$meta_title}|宅家有购管理平台</title>
<link href="__ROOT__/Public/favicon.ico" type="image/x-icon" rel="shortcut icon">
<link rel="stylesheet" type="text/css" href="__CSS__/base.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/common.css" media="all">
......@@ -22,7 +22,7 @@
<!-- 头部 -->
<div class="header">
<!-- Logo -->
<span class="logo">易和仓淘</span>
<span class="logo">宅家有购</span>
<!-- /Logo -->
<!-- 主导航 -->
......
......@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>易和仓淘跳转提示</title>
<title>宅家有购跳转提示</title>
<style type="text/css">
*{ padding: 0; margin: 0; }
body{ background: #290C0C; font-family: '微软雅黑'; color: #fff; font-size: 16px; }
......
......@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<title>欢迎您登录易和仓淘</title>
<title>欢迎您登录宅家有购</title>
<link href="__ROOT__/Public/favicon.ico" type="image/x-icon" rel="shortcut icon">
<link rel="stylesheet" type="text/css" href="__CSS__/login.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/{$Think.config.COLOR_STYLE}.css" media="all">
......@@ -14,7 +14,7 @@
<div class="login-body">
<div class="login-main pr">
<form action="{:U('login')}" method="post" class="login-form">
<h3 class="welcome"><i class="login-logo"><img src="__ROOT__/Public/favicon.ico" width="35" style="margin-top: 7px;" /></i>易和仓淘管理平台</h3>
<h3 class="welcome"><i class="login-logo"><img src="__ROOT__/Public/favicon.ico" width="35" style="margin-top: 7px;" /></i>宅家有购管理平台</h3>
<div id="itemBox" class="item-box">
<div class="item">
<i class="icon-login-user"></i>
......@@ -43,6 +43,9 @@
</button>
<div class="check-tips"></div>
</div>
<div class="bgBox">
<a class="beian" href="http://www.beian.miit.gov.cn">蜀ICP备20006621号</a>
</div>
</form>
</div>
</div>
......
......@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>易和仓淘跳转提示</title>
<title>宅家有购跳转提示</title>
<style type="text/css">
*{ padding: 0; margin: 0; }
body{ background: #30333F; font-family: '微软雅黑'; color: #fff; font-size: 16px; }
......
......@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<title>订单打印|易和仓淘</title>
<title>订单打印|宅家有购</title>
<link href="__ROOT__/Public/favicon.ico" type="image/x-icon" rel="shortcut icon">
<script language="javascript" src="__STATIC__/jquery-1.4.4.min.js"></script>
<script language="javascript" src="__STATIC__/jquery.jqprint-0.3.js"></script>
......@@ -19,7 +19,7 @@
</head>
<body>
<div class="dingDan" id="dingDan" style="padding: 0;margin: 0;width: 1060px;margin: 0 auto;">
<p style="padding: 0;margin: 0;text-align: center;font-size: 30px;font-weight: 600;height: 45px;"><img src="__ROOT__/Public/logo2.png" alt="" width="40" style="margin-top: -8px;" align="absmiddle"> 易和仓淘配送单</p>
<p style="padding: 0;margin: 0;text-align: center;font-size: 30px;font-weight: 600;height: 45px;"><img src="__ROOT__/Public/logo2.png" alt="" width="40" style="margin-top: -8px;" align="absmiddle"> 宅家有购配送单</p>
<div style="padding: 0;margin: 0;border: 1px solid grey;border-bottom: 0;">
<div class="biaoTi" style="font-size: 22px;padding: 0;margin: 0;height: auto;overflow: hidden;width: 100%;">
<p style="padding: 0;margin: 0;width: 588px;height: 30px;line-height: 30px;border-right: 1px solid grey;float: left;border-bottom: 1px solid grey;">订单号:{$rows.order_num}</p>
......@@ -36,7 +36,7 @@
</div>
<div class="biaoTi" style="font-size: 18px;padding: 0;margin: 0;height: auto;overflow: hidden;width: 100%;">
<p style="padding: 0;margin: 0;width: 588px;height: 30px;line-height: 30px;border-right: 1px solid grey;float: left;border-bottom: 1px solid grey;">付款方式:<eq name="rows.pay_type" value="1">支付宝支付</eq><eq name="rows.pay_type" value="2">货到付款</eq><eq name="rows.pay_type" value="3">微信支付</eq></p>
<p style="padding: 0;margin: 0;width: 469px;height: 30px;line-height: 30px;float: left;border-bottom: 1px solid grey;">配送方式:<eq name="rows.type" value="1">全配送</eq><eq name="rows.type" value="2">库存购</eq></p>
<p style="padding: 0;margin: 0;width: 469px;height: 30px;line-height: 30px;float: left;border-bottom: 1px solid grey;">配送方式:<eq name="rows.type" value="1">立即购买</eq><eq name="rows.type" value="2">库存购</eq></p>
</div>
<div class="biaoTi" style="font-size: 18px;padding: 0;margin: 0;height: auto;overflow: hidden;width: 100%;">
<p style="padding: 0;margin: 0;width: 588px;height: 30px;line-height: 30px;border-right: 1px solid grey;float: left;border-bottom: 1px solid grey;">商品总价:¥{$rows.s_price}</p>
......@@ -149,7 +149,7 @@
<p style="padding: 0;margin: 0;width: 25%;float: left;text-indent: 2em;height: 35px;">客户:</p>
</div>
<div style="font-size: 18px;padding: 0;margin: 0;width: 100%;">
<p style="padding: 0;margin: 0;width: 30%;float: left;text-indent: 2em;">易和仓淘:{$rows.group.title}</p>
<p style="padding: 0;margin: 0;width: 30%;float: left;text-indent: 2em;">宅家有购:{$rows.group.title}</p>
<p style="padding: 0;margin: 0;width: 25%;float: left;text-indent: 2em;">联系电话:{$rows.group.group_tel}</p>
<p style="padding: 0;margin: 0;width: 44%;float: left;text-indent: 2em;">地址:{$rows.group.p_name}{$rows.group.c_name}{$rows.group.c2_name}{$rows.group.detail}</p>
</div>
......
......@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<title>订单打印|易和仓淘</title>
<title>订单打印|宅家有购</title>
<link href="__ROOT__/Public/favicon.ico" type="image/x-icon" rel="shortcut icon">
<script language="javascript" src="__STATIC__/jquery-1.4.4.min.js"></script>
<script language="javascript" src="__STATIC__/jquery.jqprint-0.3.js"></script>
......@@ -19,7 +19,7 @@
</head>
<body>
<div class="dingDan" id="dingDan" style="padding: 0;margin: 0;width: 1020px;margin: 0 auto;">
<p style="padding: 0;margin: 0;text-align: center;font-size: 30px;font-weight: 600;height: 45px;"><img src="__ROOT__/Public/logo2.png" alt="" width="40" style="margin-top: -8px;" align="absmiddle"> 易和仓淘配送单</p>
<p style="padding: 0;margin: 0;text-align: center;font-size: 30px;font-weight: 600;height: 45px;"><img src="__ROOT__/Public/logo2.png" alt="" width="40" style="margin-top: -8px;" align="absmiddle"> 宅家有购配送单</p>
<div style="padding: 0;margin: 0;border: 1px solid grey;border-bottom: 0;">
<div class="biaoTi" style="padding: 0;margin: 0;height: auto;overflow: hidden;width: 100%;">
<p style="padding: 0;margin: 0;width: 588px;height: 30px;line-height: 30px;border-right: 1px solid grey;float: left;border-bottom: 1px solid grey;">订单号:{$rows.order_num}</p>
......@@ -35,7 +35,7 @@
</div>
<div class="biaoTi" style="padding: 0;margin: 0;height: auto;overflow: hidden;width: 100%;">
<p style="padding: 0;margin: 0;width: 588px;height: 30px;line-height: 30px;border-right: 1px solid grey;float: left;border-bottom: 1px solid grey;">付款方式:<eq name="rows.pay_type" value="1">支付宝支付</eq><eq name="rows.pay_type" value="2">货到付款</eq><eq name="rows.pay_type" value="3">微信支付</eq></p>
<p style="padding: 0;margin: 0;width: 429px;height: 30px;line-height: 30px;float: left;border-bottom: 1px solid grey;">配送方式:<eq name="rows.type" value="1">全配送</eq><eq name="rows.type" value="2">库存购</eq></p>
<p style="padding: 0;margin: 0;width: 429px;height: 30px;line-height: 30px;float: left;border-bottom: 1px solid grey;">配送方式:<eq name="rows.type" value="1">立即购买</eq><eq name="rows.type" value="2">库存购</eq></p>
</div>
<div class="biaoTi" style="padding: 0;margin: 0;height: auto;overflow: hidden;width: 100%;">
<p style="padding: 0;margin: 0;width: 588px;height: 30px;line-height: 30px;border-right: 1px solid grey;float: left;border-bottom: 1px solid grey;">商品总价:¥{$rows.s_price}</p>
......@@ -100,7 +100,7 @@
<p style="padding: 0;margin: 0;width: 25%;float: left;text-indent: 2em;height: 35px;">客户:</p>
</div>
<div style="padding: 0;margin: 0;width: 100%;">
<p style="padding: 0;margin: 0;width: 30%;float: left;text-indent: 2em;">易和仓淘:{$rows.group.title}</p>
<p style="padding: 0;margin: 0;width: 30%;float: left;text-indent: 2em;">宅家有购:{$rows.group.title}</p>
<p style="padding: 0;margin: 0;width: 25%;float: left;text-indent: 2em;">联系电话:{$rows.group.group_tel}</p>
<p style="padding: 0;margin: 0;width: 44%;float: left;text-indent: 2em;">地址:{$rows.group.p_name}{$rows.group.c_name}{$rows.group.c2_name}{$rows.group.detail}</p>
</div>
......
......@@ -75,7 +75,7 @@
规格:{$v.stan|default="无"}
</div>
<div>
配送方式:<eq name="rows.type" value="1">全配送</eq><eq name="rows.type" value="2">库存购</eq><br/>
配送方式:<eq name="rows.type" value="1">立即购买</eq><eq name="rows.type" value="2">库存购</eq><br/>
支付方式:<eq name="rows.pay_type" value="1">支付宝支付</eq><eq name="rows.pay_type" value="2">货到付款</eq><eq name="rows.pay_type" value="3">微信支付</eq><br/>
</div>
</li>
......@@ -139,7 +139,7 @@
<!-- 订单打印 -->
<div id="tab3" class="tab-pane tab3">
<div class="dingDan" id="dingDan" style="margin: 0 auto;width: 1184px;">
<p style="text-align: center;font-size: 30px;font-weight: 600;height: 45px;"><img src="__ROOT__/Public/logo2.png" alt="" width="40" style="margin-top: -6px;" align="absmiddle"> 易和仓淘配送单</p>
<p style="text-align: center;font-size: 30px;font-weight: 600;height: 45px;"><img src="__ROOT__/Public/logo2.png" alt="" width="40" style="margin-top: -6px;" align="absmiddle"> 宅家有购配送单</p>
<div style="border: 1px solid grey;border-bottom: 0;">
<div class="biaoTi">
<p style="width: 60%;border-right: 1px solid grey;height: 30px;line-height: 30px;">订单号:{$rows.order_num}</p>
......@@ -155,7 +155,7 @@
</div>
<div class="biaoTi">
<p style="width: 60%;border-right: 1px solid grey;line-height: 28px;height: 28px;">付款方式:<eq name="rows.pay_type" value="1">支付宝支付</eq><eq name="rows.pay_type" value="2">货到付款</eq><eq name="rows.pay_type" value="3">微信支付</eq></p>
<p style="width: 39.9%;line-height: 28px;height: 28px;">配送方式:<eq name="rows.type" value="1">全配送</eq><eq name="rows.type" value="2">库存购</eq></p>
<p style="width: 39.9%;line-height: 28px;height: 28px;">配送方式:<eq name="rows.type" value="1">立即购买</eq><eq name="rows.type" value="2">库存购</eq></p>
</div>
<div class="biaoTi">
<p style="width: 60%;border-right: 1px solid grey;line-height: 28px;height: 28px;">商品总价:¥{$rows.s_price}</p>
......@@ -221,7 +221,7 @@
<p style="width: 25%;float: left;text-indent: 2em;">客户:</p>
</div>
<div style="width: 100%;">
<p style="width: 30%;float: left;text-indent: 2em;">易和仓淘:{$rows.group.title}</p>
<p style="width: 30%;float: left;text-indent: 2em;">宅家有购:{$rows.group.title}</p>
<p style="width: 20%;float: left;text-indent: 2em;">联系电话:{$rows.group.group_tel}</p>
<p style="width: 50%;float: left;text-indent: 2em;">地址:{$rows.group.p_name}{$rows.group.c_name}{$rows.group.c2_name}{$rows.group.detail}</p>
</div>
......
......@@ -68,7 +68,7 @@
规格:{$v.stan|default="无"}
</div>
<div>
配送方式:<eq name="rows.type" value="1">全配送</eq><eq name="rows.type" value="2">库存购</eq><br/>
配送方式:<eq name="rows.type" value="1">立即购买</eq><eq name="rows.type" value="2">库存购</eq><br/>
支付方式:<eq name="rows.pay_type" value="1">支付宝支付</eq><eq name="rows.pay_type" value="2">货到付款</eq><br/>
</div>
</li>
......@@ -92,6 +92,7 @@
<th class="">配送状态</th>
<th class="">配送次数</th>
<th class="">剩余数量</th>
<th class="">剩余赠送数量</th>
<th class="">提交时间</th>
<th>操作</th>
</tr>
......@@ -112,6 +113,7 @@
</td>
<td>第{$vo.dist_ci}次</td>
<td>{$vo.s_sum}</td>
<td>{$vo.s_sum2}</td>
<td>{$vo.dist_time|date='Y-m-d H:i',###}</td>
<td>
<eq name="vo.dist_type" value="1"><a href="{:U('inve/change?id='.$vo['id'].'&dist_type=2')}">点击发货</a></eq>
......@@ -225,7 +227,7 @@
支付方式:<eq name="rows.pay_type" value="1">支付宝</eq><eq name="rows.pay_type" value="2">货到付款</eq>
</span>
<span style="margin-left: 20px;">
配送方式:<eq name="rows.type" value="1">全配送</eq><eq name="rows.type" value="2">库存购</eq>
配送方式:<eq name="rows.type" value="1">立即购买</eq><eq name="rows.type" value="2">库存购</eq>
</span><br/>
<span>订单状态:
<eq name="rows.status1" value="1">待付款</eq>
......@@ -271,9 +273,11 @@
<th style="border: 1px grey dashed;text-align: center;">电话</th>
<th style="border: 1px grey dashed;text-align: center;">地址</th>
<th style="border: 1px grey dashed;text-align: center;">配送数量</th>
<th style="border: 1px grey dashed;text-align: center;">配送赠送数量</th>
<th style="border: 1px grey dashed;text-align: center;">配送状态</th>
<th style="border: 1px grey dashed;text-align: center;">配送次数</th>
<th style="border: 1px grey dashed;text-align: center;">剩余数量</th>
<th style="border: 1px grey dashed;text-align: center;">剩余赠送数量</th>
<th style="border: 1px grey dashed;text-align: center;">提交时间</th>
</tr>
<notempty name="rows.dist">
......@@ -284,13 +288,16 @@
<td style="border: 1px grey dashed;text-align: center;">{$vo.u_tel}</td>
<td style="border: 1px grey dashed;text-align: center;">{$vo.u_add}</td>
<td style="border: 1px grey dashed;text-align: center;">{$vo.dist_sum} </td>
<td style="border: 1px grey dashed;text-align: center;">{$vo.dist_sum2} </td>
<td style="border: 1px grey dashed;text-align: center;">
<eq name="vo.dist_type" value="1">未配送</eq>
<eq name="vo.dist_type" value="2">配送中</eq>
<eq name="vo.dist_type" value="3">已完成</eq>
</td>
<td style="border: 1px grey dashed;text-align: center;">第{$voi}次</td>
<!-- <td style="border: 1px grey dashed;text-align: center;">第{$voi}次</td>-->
<td style="border: 1px grey dashed;text-align: center;">第{$vo.dist_ci}次</td>
<td style="border: 1px grey dashed;text-align: center;">{$vo.s_sum}</td>
<td style="border: 1px grey dashed;text-align: center;">{$vo.s_sum2}</td>
<td style="border: 1px grey dashed;text-align: center;">{$vo.dist_time|date='Y-m-d H:i',###}</td>
</tr>
<volist name="vo.goods" id="v">
......
......@@ -72,7 +72,7 @@
规格:{$v.stan|default="无"}
</div>
<div>
配送方式:<eq name="rows.type" value="1">全配送</eq><eq name="rows.type" value="2">库存购</eq><br/>
配送方式:<eq name="rows.type" value="1">立即购买</eq><eq name="rows.type" value="2">库存购</eq><br/>
支付方式:<eq name="rows.pay_type" value="1">支付宝支付</eq><eq name="rows.pay_type" value="2">货到付款</eq><br/>
</div>
</li>
......@@ -186,7 +186,7 @@
支付方式:<eq name="rows.pay_type" value="1">支付宝</eq><eq name="rows.pay_type" value="2">货到付款</eq>
</span>
<span style="margin-left: 20px;">
配送方式:<eq name="rows.type" value="1">全配送</eq><eq name="rows.type" value="2">库存购</eq>
配送方式:<eq name="rows.type" value="1">立即购买</eq><eq name="rows.type" value="2">库存购</eq>
</span><br/>
<span>订单状态:
<eq name="rows.status1" value="1">待付款</eq>
......
......@@ -185,8 +185,8 @@ function Logs($msg = '', $file = 'debug.txt') {
* @author 穆风杰 <374037066@qq.com>
*/
function getFreight($add){
//$lnt_lat=file_get_contents('http://apis.map.qq.com/ws/geocoder/v1/?address='.$add.'&key=26DBZ-JHYRX-WAJ4Q-ZHXIQ-SXZTF-XGF3V');
$lnt_lat=file_get_contents('http://api.map.baidu.com/geocoder/v2/?address='.$add.'&output=json&ak=V9zYV8ha7MUFqVXic6qxWM1vb3tySQa3');
$lnt_lat=file_get_contents('http://apis.map.qq.com/ws/geocoder/v1/?address='.$add.'&key=26DBZ-JHYRX-WAJ4Q-ZHXIQ-SXZTF-XGF3V');
// $lnt_lat=file_get_contents('http://api.map.baidu.com/geocoder/v2/?address='.$add.'&output=json&ak=V9zYV8ha7MUFqVXic6qxWM1vb3tySQa3');
$lnt_lat=json_decode($lnt_lat);
$new_lnt_lat=array(
'lat'=>$lnt_lat->result->location->lat,
......
......@@ -11,10 +11,13 @@
* 系统配文件
* 所有系统级别的配置
*/
return array(
/* 模块相关配置 */
'AUTOLOAD_NAMESPACE' => array('Addons' => ONETHINK_ADDON_PATH), //扩展模块列表
'DEFAULT_MODULE' => 'Home',
// 'DEFAULT_MODULE' => 'Home',
//
'DEFAULT_MODULE' => DEFAULT_MODULE,
'MODULE_DENY_LIST' => array('Common', 'User'),
//'MODULE_ALLOW_LIST' => array('Home','Admin'),
......
......@@ -29,11 +29,13 @@ class ApiIndentController extends Controller
if(!isset($_GET['numbers'])||empty($_GET['numbers'])){echo json2(406,'商品数量不能为空','error');die;}
$lat_lng = $this->getLatLng($_GET['site_id']);//获取用户地址坐标
if(!$lat_lng){echo json2(404,'收货地址无效!','error');die;}
$group=$this->getGroupId($lat_lng);//查询城市仓库
$site=$this->getUserSite($_GET['site_id']);//获取用户信息
if(!$site){echo json2(404,'收货地址无效!','error');die;}
$group=$this->getGroupId($lat_lng, $site['is_vip']);//查询城市仓库
if(!$group){echo json2(405,'该城市无配送仓库!','error');die;}
$gidS=explode(',',$_GET['gid']);
foreach($gidS as $key=>$v){
$goods_group[$key]=$this->getIssetGoods($group,$lat_lng['county'],0,$v);
$goods_group[$key]=$this->getIssetGoods($group,$lat_lng['county'],0,$v,$site['is_vip']);
}
$Qid=null;//接受不能配送商品
$money=0;//价格
......@@ -95,8 +97,8 @@ class ApiIndentController extends Controller
}
//获取仓库id
private function getGroupId($lat_lng,$id=0){
$auth_group=M('auth_group');
private function getGroupId($lat_lng,$isVip=0){
// $auth_group=M('auth_group');
$lat=$lat_lng['lat'];//纬度
$lng=$lat_lng['lng'];//经度
$order = 'ACOS(SIN(('.$lat.' * 3.1415) / 180 ) *SIN((lat * 3.1415) / 180 )
......@@ -104,11 +106,28 @@ class ApiIndentController extends Controller
COS(('.$lng.'* 3.1415) / 180 - (lng * 3.1415) / 180 ) ) * 6380 ASC';
//查询最近分仓
$group=$auth_group->where('city='.$lat_lng['city'].' and id!='.$id)->field('id group_id,lng,lat,detail')->order($order)->find();
// if ($isVip) {
// $g_group=M('goodsGroup');
// $group=$g_group->join('yi_auth_group ag on yi_goods_group.group_id = ag.id')
// ->where('ag.is_vip=1')
// ->field('ag.id as group_id,ag.lng,ag.lat,ag.detail')
// ->order($order)
// ->find();
// } else {
// $group=$auth_group->where('city='.$lat_lng['city'])->field('id group_id,lng,lat,detail')->order($order)->find();
// }
$g_group=M('goodsGroup');
$group=$g_group->join('yi_auth_group ag on yi_goods_group.group_id = ag.id')
->where('ag.is_vip=' . $isVip)
->field('ag.id as group_id,ag.lng,ag.lat,ag.detail')
->order($order)
->find();
$geocode = file_get_contents("http://api.map.baidu.com/geocoder/v2/?address=".$group['detail']."&output=json&ak=V9zYV8ha7MUFqVXic6qxWM1vb3tySQa3");
$outputss= json_decode($geocode,true);
// $geocode = file_get_contents("http://api.map.baidu.com/geocoder/v2/?address=".$group['detail']."&output=json&ak=V9zYV8ha7MUFqVXic6qxWM1vb3tySQa3");
// $outputss= json_decode($geocode,true);
// $group['lng'] =$outputss['result']['location']['lng'];
//
......@@ -121,7 +140,7 @@ class ApiIndentController extends Controller
}
}
//查询仓库是否存在此商品 库存是否大于0
private function getIssetGoods($group,$county,$cart_id=0,$gid=0){
private function getIssetGoods($group,$county,$cart_id=0,$gid=0,$isVip=0){
$dist=M('distribution');//判断配送范围
$g_group=M('goodsGroup');//判断商品是否存在
if($cart_id!=0){//存在购物车 从购物车获取商品id
......@@ -135,23 +154,21 @@ class ApiIndentController extends Controller
$where['r_repe']=array('GT',0);
$is_set_goods=null;
foreach($group as $v){
$where['group_id']=$v;
$where['group_id']=$group['group_id'];
$is_set_goods=$g_group->where($where)->find();
if($is_set_goods){
$distMoney=$dist->where('group_id='.$v.' and county='.$county)
if($is_set_goods || $isVip){
$distMoney=$dist->where('group_id='.$group['group_id'].' and county='.$county)
->field('id dis_id,money,univalent')
->find();
if($distMoney){
$goods_group['goods_id']=$where['goods_id'];
$goods_group['group_id']=$v;
$goods_group['group_id']=$group['group_id'];
$goods_group['money']=$distMoney['money'];
$goods_group['univalent']=$distMoney['univalent'];
$goods_group['cart_id']=$cart_id;
return $goods_group;
}
}
}
if(!$is_set_goods){
$goods_group['goods_id']=$where['goods_id'];
$goods_group['group_id']=0;
......@@ -180,7 +197,6 @@ class ApiIndentController extends Controller
$userInfo=$user->where('id='.$_GET['uid'])->field('is_shop, is_vip')->find();
$goods=M('goods');
$dredge = M('dredge')->where('id='.$_GET['cityId'])->field('meet, reduce')->find();
if(isset($_GET['sum'])||!empty($_GET['sum'])){//存在商品数量执行快速购买
$list1=$goods->where('yi_goods.id='.$_GET['gid'])
->field('yi_goods.id,title,z_img,goods_model,price,suggest_price, vip_price, favorable,meet,reduce,quota,k_quota,dist_quota')
......@@ -202,21 +218,16 @@ class ApiIndentController extends Controller
$list1['z_price']=$list1['price']*$list1['sum'];
}
}
if($list1['favorable']==0){
$list1['explain']='0';
}elseif($list1['favorable']==2){//满就减
if($list1['favorable']==2 && $list1['meet'] > 0){//满就减
$mo=floor($list1['z_price']/$list1['meet']);
$list1['explain']=$list1['reduce']*$mo;
}elseif($list1['favorable']==1){//满就送
}elseif($list1['favorable']==1 && $list1['meet'] > 0){//满就送
$mo=floor($list1['sum']/$list1['meet']);
$list1['explain']=$list1['reduce']*$mo;
}
// // 城市满减
// if ($dredge['meet'] > 0) {
// $mo2 = floor($list1['sum']/$dredge['meet']);
// $list1['explain']+=$dredge['reduce']*$mo2;
// }
unset($list1['suggest_price']);//去除推荐价格
unset($list1['vip_price']);//去除推荐价格
unset($list1['meet']);
unset($list1['reduce']);
$list[0]=$list1;
......@@ -253,21 +264,16 @@ class ApiIndentController extends Controller
$rows['z_price']=$rows['price']*$rows['sum'];
}
}
if($rows['favorable']==0){
$rows['explain']=0;
}elseif($rows['favorable']==2){//满就减
$rows['explain']='0';
if($rows['favorable']==2 && $rows['meet'] > 0){//满就减
$mo=floor($rows['z_price']/$rows['meet']);
$rows['explain']=$rows['reduce']*$mo;
}elseif($rows['favorable']==1){//满就送
}elseif($rows['favorable']==1 && $rows['meet'] > 0){//满就送
$mo=floor($rows['sum']/$rows['meet']);
$rows['explain']=$rows['reduce']*$mo;
}
// // 城市满减
// if ($dredge['meet'] > 0) {
// $mo2 = floor($rows['sum']/$dredge['meet']);
// $rows['explain']+=$dredge['reduce']*$mo2;
// }
unset($rows['suggest_price']);//去除推荐价格
unset($rows['vip_price']);//去除推荐价格
unset($rows['meet']);
unset($rows['reduce']);
$list[$key]=$rows;
......@@ -281,17 +287,20 @@ class ApiIndentController extends Controller
foreach($list as $key=>$v){
$z_price+=$v['z_price'];//计算商品总价
}
// // 城市满减
// if ($dredge['meet'] > 0) {
// $mo2 = floor($list1['sum']/$dredge['meet']);
// $list1['explain']+=$dredge['reduce']*$mo2;
// }
if($z_price>=$sat['satisfy']){
$new_list['is_coup']=false;//满足优惠要求
}else{
$new_list['is_coup']=true;
}
// todo 城市满减 暂缓
$cexplain = 0;
$dredge = M('dredge')->where('id='.$_GET['cityId'])->field('meet, reduce')->find();
if ($dredge['meet'] > 0) {
$mo2 = floor($z_price / $dredge['meet']);
$cexplain = $dredge['reduce'] * $mo2;
}
$new_list['explain'] = $cexplain;
$new_list['list']=$list;
if($list){
echo json2(200,'success',$new_list);
......@@ -320,7 +329,7 @@ class ApiIndentController extends Controller
$_data['time']=time();
$lat_lng = $this->getLatLng($_POST['site_id']);//获取用户地址坐标
if(!$lat_lng){echo json2(404,'收货地址无效!','error');die;}
$group=$this->getGroupId($lat_lng);//查询城市仓库列表
$group=$this->getGroupId($lat_lng, $site['is_vip']);//查询城市仓库列表
if(!$group){echo json2(405,'该城市无配送仓库!','error');die;}
if(isset($_POST['gid'])||!empty($_POST['gid'])){//商品id不为空的时候 拆分商品id
$gidS=explode(',',$_POST['gid']);
......@@ -328,14 +337,13 @@ class ApiIndentController extends Controller
if(isset($_POST['cart_id'])&&!empty($_POST['cart_id'])){//存在购物车id 从购物车取出商品id
$cart_id=explode(',',$_POST['cart_id']);
foreach($cart_id as $key=>$v){//多条商品循环获取
$goods_group[$key]=$this->getIssetGoods($group,$lat_lng['county'],$v);
$goods_group[$key]=$this->getIssetGoods($group,$lat_lng['county'],$v,0, $site['is_vip']);
}
$gidS=$this->getGid($cart_id);
}else{//单商品购买
$goods_group[0]=$this->getIssetGoods($group,$lat_lng['county'],0,$_POST['gid']);
$goods_group[0]=$this->getIssetGoods($group,$lat_lng['county'],0,$_POST['gid'],$site['is_vip']);
}
if(!$gidS){echo json2(4011,'商品id获取失败!','error');die;}
$Qid=null;//接受不能配送商品
$money=0;//价格
foreach($goods_group as $key=>$v){
......@@ -357,23 +365,31 @@ class ApiIndentController extends Controller
$couMsg=$this->changeCoupon($site['u_id'],$_POST['cou_id']);
if(!$couMsg){echo json2(407,'优惠券使用失败!','error');die;}//订单生成成功 修改会员优惠券状态
}
foreach($goods_group as $v){
if($v['group_id']==0){echo json2(4012,'商品 '.$v['goods_id'].' 库存不足','error');die;}
}
if(isset($_POST['sum'])&&!empty($_POST['sum'])){//存在数量 进行单品计算
$priceS=$this->get_z_price($_POST['gid'],$site['u_id'],$site['city_id'],$_POST['sum']);
$priceS=$this->get_z_price($_POST['gid'],$site,$_POST['sum']);
$stan=isset($_POST['stan'])?$_POST['stan']:null;
$order_goods=$this->allocationGoods($goods_group,$site['u_id'],$site['city_id'],$_POST['sum'],$stan);
$order_goods=$this->allocationGoods($goods_group,$site,$_POST['sum'],$stan);
}else{//不存在 执行购物车计算
$priceS=$this->get_z_price($_POST['cart_id'],$site['u_id'],$site['city_id']);
$order_goods=$this->allocationGoods($goods_group,$site['u_id'],$site['city_id']);
$priceS=$this->get_z_price($_POST['cart_id'],$site);
$order_goods=$this->allocationGoods($goods_group,$site);
}
$_data['z_price']=$priceS['z_price'];//商品总价格
//判断是否满足配送费优惠
$sat=$this->getSatisfy();
// if($_data['z_price']>=$sat['satisfy']){$_data['dis_price']=0;}
$_data['y_price']=$priceS['y_price'];//商品总优惠价格
// todo 城市满减
$cexplain = 0;
$dredge = M('dredge')->where('id='.$_POST['cart_id'])->field('meet, reduce')->find();
if ($dredge['meet'] > 0) {
$mo2 = floor( $priceS['z_price'] / $dredge['meet']);
$cexplain = $dredge['reduce'] * $mo2;
}
$_data['y_price']=($priceS['y_price'] + $cexplain);//商品总优惠价格
// $_data['s_price']=$_data['z_price']+$_data['dis_price']-$_data['cou_price']-$_data['y_price'];//订单最终价格
$_data['s_price']=$_data['z_price']+$_POST['dis_price']-$_data['cou_price']-$_data['y_price'];//订单最终价格
$order=M('order');//添加订单数据
......@@ -388,18 +404,18 @@ class ApiIndentController extends Controller
if(!$msg2){$flog=2;return;}//如果存在一次失败 标记改变
$this->addGoodsSales($v['goods_id'],$v['z_sum']);//修改销量
}
if($_data['type']==2){//如果是库存购 执行以下代码
$dist_order=M('distOrder');
$dist['order_id']=$msg;
$dist['dist_sum']=$_POST['dist_sum'];
$dist['u_name']=$_data['u_name'];
$dist['u_tel']=$_data['u_tel'];
$dist['u_add']=$_data['u_add'];
$dist['s_sum']=$order_goods[0]['z_sum']-$_POST['dist_sum'];
$dist['dist_time']=time();
$dist_msg=$dist_order->data($dist)->add();
if(!$dist_msg){$flog=2;}
// todo 库存购 不下单
// $dist_order=M('distOrder');
// $dist['order_id']=$msg;
// $dist['dist_sum']=$_POST['dist_sum'];
// $dist['u_name']=$_data['u_name'];
// $dist['u_tel']=$_data['u_tel'];
// $dist['u_add']=$_data['u_add'];
// $dist['s_sum']=$order_goods[0]['z_sum']-$_POST['dist_sum'];
// $dist['dist_time']=time();
// $dist_msg=$dist_order->data($dist)->add();
// if(!$dist_msg){$flog=2;}
}
if($flog==1){
......@@ -467,76 +483,61 @@ class ApiIndentController extends Controller
private function getUserSite($id){
$site=M('site');
$info=$site->where('yi_site.id='.$id)
->field('yi_site.id,u_id,s_name,phone,a1.name p_name,a2.name c_name,a3.name co_name,detail,yi_dredge.id city_id')
->field('yi_site.id,u_id,yi_user.is_vip, yi_user.is_shop, s_name,phone,a1.name p_name,a2.name c_name,a3.name co_name,detail,yi_dredge.id city_id')
->join('yi_area a1 on yi_site.province=a1.id')
->join('yi_area a2 on yi_site.city=a2.id')
->join('yi_area a3 on yi_site.county=a3.id')
->join('yi_dredge on yi_site.city=yi_dredge.city')
->join('yi_user on yi_user.id=u_id')
->find();
$info['detail']=$info['p_name'].$info['c_name'].$info['co_name'].$info['detail'];
if($info){
$info['detail']=$info['p_name'].$info['c_name'].$info['co_name'].$info['detail'];
return $info;
}else{
return null;
}
}
//获取商品总价
private function get_z_price($gid,$uid,$city,$sum=0){
$user=M('user');//判断用户是否是认证用户
$userInfo=$user->where('id='.$uid)->field('is_shop')->find();
private function get_z_price($gid,$site,$sum=0){
$city = $site['city_id'];
$goods=M('gPrice');
$z_price=0;
$y_price=0;
$priceS=null;
$priceS=[];
if($sum==0){//从购物车进入
$shopCart=M('shopCart');
$gidS=explode(',',$gid);
if($userInfo['is_shop']==1){//认证会员
foreach($gidS as $key=>$v){
$info=$shopCart->where('id='.$v)->field('gid,sum')->find();
$price=$goods->where('goods_id='.$info['gid'].' and city_id='.$city)
->field('goods_id gid,price,favorable,meet,reduce')
->field('goods_id gid,price, suggest_price, vip_price,favorable,meet,reduce')
->find();
$z_price=$info['sum']*$price['price'];
$priceS['z_price']+=$z_price;
if($price['favorable']==2){//算出该商品优惠金额
$mo=floor($z_price/$price['meet']);
$y_price=$price['reduce']*$mo;
$priceS['y_price']+=$y_price;
$mo=0;
//$z_price=0;
}
$z_price=0;
}
if ($site['is_vip']) { //vip
$pprice = $price['vip_price'];
} elseif($site['is_shop']==1){//认证会员
$pprice = $price['suggest_price'];
}else{//普通会员
foreach($gidS as $key=>$v){
$info=$shopCart->where('id='.$v)->field('gid,sum')->find();
$price=$goods->where('goods_id='.$info['gid'].' and city_id='.$city)
->field('goods_id gid,suggest_price,favorable,meet,reduce')->find();
$z_price+=$info['sum']*$price['suggest_price'];
$pprice = $price['price'];
}
$z_price=$info['sum']*$pprice;
$priceS['z_price']+=$z_price;
if($price['favorable']==2){//算出该商品优惠金额
$mo=floor($z_price/$price['meet']);
$y_price=$price['reduce']*$mo;
$priceS['y_price']+=$y_price;
$mo=0;
}
$z_price=0;
}
}
}else{//单品购买
if($userInfo['is_shop']==1){//认证会员
$price=$goods->where('goods_id='.$gid.' and city_id='.$city)
->field('goods_id gid,price,favorable,meet,reduce')
->field('goods_id gid,price, suggest_price, vip_price, favorable,meet,reduce')
->find();
$priceS['z_price']=$z_price=$sum*$price['price'];
if ($site['is_vip']) { //vip
$pprice = $price['vip_price'];
} elseif($site['is_shop']==1){//认证会员
$pprice = $price['suggest_price'];
}else{//普通会员
$price=$goods->where('goods_id='.$gid.' and city_id='.$city)
->field('goods_id gid,suggest_price,favorable,meet,reduce')->find();
$priceS['z_price']=$z_price=$sum*$price['suggest_price'];
$pprice = $price['price'];
}
$priceS['z_price']=$z_price=$sum*$pprice;
if($price['favorable']==2){//算出该商品优惠金额
$mo=floor($z_price/$price['meet']);
$y_price=$price['reduce']*$mo;
......@@ -553,9 +554,8 @@ class ApiIndentController extends Controller
* @sum 商品数量 如果不传或者等于0 则从购物车获取
* @stan 商品规格 如果不传或者等于NULL 则从购物车获取
*/
private function allocationGoods($goods_group,$uid,$city,$sum=0,$stan=null){
$user=M('user');//判断用户是否是认证用户
$userInfo=$user->where('id='.$uid)->field('is_shop')->find();
private function allocationGoods($goods_group,$site,$sum=0,$stan=null){
$city = $site['city_id'];
$g_price=M('gPrice');//商品价格
if($sum==0){//如果商品==0 执行购物车购买
$shop_cart=M('shopCart');
......@@ -564,25 +564,21 @@ class ApiIndentController extends Controller
$price=$g_price->where('goods_id='.$v['goods_id'].' and city_id='.$city)->find();
$goods_group[$key]['cou_sum']=0;//默认赠送0件
$goods_group[$key]['cou_price']=0;//默认优惠0元
if ($site['is_vip']) { //vip
$pprice = $price['vip_price'];
} elseif($site['is_shop']==1){//认证会员
$pprice = $price['suggest_price'];
}else{//普通会员
$pprice = $price['price'];
}
if($price['favorable']==1){//满就送
$mo=floor($info['sum']/$price['meet']);
$goods_group[$key]['cou_sum']=$mo*$price['reduce'];
$mo=0;//计算完 归0;
}elseif($price['favorable']==2){//满就减
if($userInfo['is_shop']==1){//认证会员
$mo=floor($price['price']*$info['sum']/$price['meet']);
$goods_group[$key]['cou_price']=$mo*$price['reduce'];
}else{//普通会员
$mo=floor($price['suggest_price']*$info['sum']/$price['meet']);
$mo=floor($pprice*$info['sum']/$price['meet']);
$goods_group[$key]['cou_price']=$mo*$price['reduce'];
}
$mo=0;//计算完归0
}
if($userInfo['is_shop']==1){//认证会员
$goods_group[$key]['g_price']=$price['price'];//单价
}else{//普通会员
$goods_group[$key]['g_price']=$price['suggest_price'];//单价
}
$goods_group[$key]['g_price']=$pprice;//单价
$goods_group[$key]['g_sum']=$info['sum'];//商品数量
$goods_group[$key]['stan']=$info['stan'];//商品规格
$goods_group[$key]['z_sum']=$info['sum']+$goods_group[$key]['cou_sum'];//单商品总数量
......@@ -594,26 +590,21 @@ class ApiIndentController extends Controller
$price=$g_price->where('goods_id='.$v['goods_id'].' and city_id='.$city)->find();
$goods_group[$key]['cou_sum']=0;//默认赠送0件
$goods_group[$key]['cou_price']=0;//默认优惠0元
if ($site['is_vip']) { //vip
$pprice = $price['vip_price'];
} elseif($site['is_shop']==1){//认证会员
$pprice = $price['suggest_price'];
}else{//普通会员
$pprice = $price['price'];
}
if($price['favorable']==1){//满就送
$mo=floor($sum/$price['meet']);
$goods_group[$key]['cou_sum']=$mo*$price['reduce'];
$mo=0;//计算完 归0;
}elseif($price['favorable']==2){//满就减
if($userInfo['is_shop']==1){//认证会员
$mo=floor($price['price']*$sum/$price['meet']);
$mo=floor($pprice*$sum/$price['meet']);
$goods_group[$key]['cou_price']=$mo*$price['reduce'];
}else{//普通会员
$mo=floor($price['suggest_price']*$sum/$price['meet']);
$goods_group[$key]['cou_price']=$mo*$price['reduce'];
}
$mo=0;//计算完归0
}
if($userInfo['is_shop']==1){//认证会员
$goods_group[$key]['g_price']=$price['price'];//单价
}else{//普通会员
$goods_group[$key]['g_price']=$price['suggest_price'];//单价
}
$goods_group[$key]['g_price']=$pprice;//单价
$goods_group[$key]['g_sum']=$sum;//商品数量
$goods_group[$key]['stan']=$stan;//商品规格
$goods_group[$key]['z_sum']=$sum+$goods_group[$key]['cou_sum'];//单商品总数量
......
......@@ -31,6 +31,17 @@ class ApiOrderController extends Controller
if(!IS_GET){echo json2(402,'请求方式有误!','error');die;}
if(!isset($_GET['uid'])||empty($_GET['uid'])){echo json2(401,'用户id=null','error');die;}
$order=M('order');
// todo 库存购 到期后无法再次提货, 自动完成
$config = M("Config")->where(['name' => 'STORE_BUY_LIMIT'])->field('value')->order('sort')->find();
$limitTime = !empty($config['value']) ? $config['value'] : '2592000'; // 30天
$limitOrders = $order->where('status=1 and order_type!=6 and type=2 and time <' . (time()-$limitTime))->field('id')->select();
if ($limitOrders) {
foreach ($limitOrders as $limitOrder) {
M('order')->where('id=' . $limitOrder['id'])->data('order_type=6')->save();//交易完成
M('orderGoods')->where('order_id=' . $limitOrder['id'])->data('status=4')->save();
}
}
$where['uid']=$_GET['uid'];
$where['status']=array('NEQ',2);
if(isset($_GET['type'])&&!empty($_GET['type'])){
......@@ -112,8 +123,9 @@ class ApiOrderController extends Controller
//->join('yi_dist_order do on yi_order.id=do.order_id')
->find();
$dist_order=M('distOrder');
$dist_info=$dist_order->where('order_id='.$info['id'])->field('s_sum')->order('id desc')->find();
$info['s_sum']=$dist_info['s_sum'];
$dist_info=$dist_order->where('order_id='.$info['id'])->field('s_sum, s_sum2')->order('id desc')->find();
$info['s_sum']=!empty($dist_info) ? $dist_info['s_sum'] : $info['g_sum'];
$info['s_sum2']=!empty($dist_info) ? $dist_info['s_sum2'] : $info['cou_sum'];
if($info){
echo json2(200,'success',$info);
}else{
......@@ -131,22 +143,42 @@ class ApiOrderController extends Controller
$order_info=$this->getGroupDist($_POST['order_num'],$site_info['county']);
if($order_info==201){echo json2(406,'订单号有误!仓库获取失败!','error');die;}
if(!$order_info){echo json2(408,'此地址超出配送范围!','error');die;}
if ($_POST['dist_sum'] > $order_info['g_sum']) {
echo json2(410,'配送数量大于剩余数量!','error');die;
}
$dist_info=$this->getOneDistOrder($order_info['id']);
$dist_order=M('distOrder');
if($dist_info){
if($dist_info['dist_type']!=3){echo json2(409,'还有配送任务未完成!请勿重复提交!','error');die;}
if ($_POST['dist_sum'] > $dist_info['s_sum']) {
echo json2(410,'配送数量大于剩余数量!','error');die;
}
$s_sum = $dist_info['s_sum'];
$s_sum2 = $dist_info['s_sum2'];
$dist_ci = $dist_info['dist_ci'] + 1;
}else{
$s_sum = $order_info['g_sum'];
$s_sum2 = $order_info['cou_sum'];
$dist_ci = 1;
}
$data['s_sum']=$s_sum - $_POST['dist_sum'];
// 按百分比 配送 赠送
if ($data['s_sum'] <= 0 || $s_sum2 <= 0) {
$dist_sum2 = $s_sum2;
} else {
$dist_sum2 = round($_POST['dist_sum']/$order_info['g_sum']*$order_info['cou_sum']);
}
$data['dist_ci'] = $dist_ci;
$data['s_sum2']=$s_sum2 - $dist_sum2;
$data['order_id']=$order_info['id'];
$data['dist_sum']=$_POST['dist_sum'];
$data['dist_sum2']=$dist_sum2;
$data['u_name']=$site_info['s_name'];
$data['u_tel']=$site_info['phone'];
$data['u_add']=$site_info['detail'];
$data['dist_time']=time();
if($dist_info){
if($dist_info['dist_type']!=3){echo json2(409,'还有配送任务未完成!请勿重复提交!','error');die;}
$data['s_sum']=$dist_info['s_sum']-$_POST['dist_sum'];
}else{
$data['s_sum']=$order_info['z_sum'];
}
$dist_order=M('distOrder');
$msg=$dist_order->data($data)->add();
$dist_order->where('id='.$msg)->setInc('dist_ci');
// $dist_order->where('id='.$msg)->setInc('dist_ci');
if($msg){
echo json2(200,'提交成功!','success');
}else{
......@@ -170,23 +202,27 @@ class ApiOrderController extends Controller
$order_info['is_return']=true;
}
if(!$order_info){echo json2(400,'抱歉订单获取失败!请稍后在试!','error');die;}
$order_info['s_sum']=0;
if($order_info['type']==2){//库存购商品 查询剩余数量
$dist_order=M('dist_order');
$dist_info=$dist_order->where('order_id='.$order_info['id'])->order('id desc')->find();
if(!$dist_info){echo json2(400,'抱歉剩余数量获取失败!请客观稍后在试!','error');die;}
$order_info['s_sum']=$dist_info['s_sum'];
$order_info['u_name']=$dist_info['u_name'];
$order_info['u_tel']=$dist_info['u_tel'];
$order_info['u_add']=$dist_info['u_add'];
$order_info['deliver_time']=$dist_info['dist_time'];
}
$order_goods=M('order_goods');
$goods_info=$order_goods->where('order_id='.$order_info['id'])
->field('yi_order_goods.*,title,z_img,goods_model')
->join('yi_goods on yi_order_goods.goods_id=yi_goods.id')
->select();
$order_info['s_sum']=0;
if($order_info['type']==2){//库存购商品 查询剩余数量
$dist_order=M('dist_order');
$dist_info=$dist_order->where('order_id='.$order_info['id'])->order('id desc')->find();
// if(!$dist_info){echo json2(400,'抱歉剩余数量获取失败!请客观稍后在试!','error');die;}
$order_info['s_sum']=!empty($dist_info['s_sum']) ? $dist_info['s_sum'] :$goods_info[0]['g_sum'];
$order_info['s_sum2']=!empty($dist_info['s_sum2']) ? $dist_info['s_sum2'] :$goods_info[0]['cou_sum'];
$order_info['u_name']=!empty($dist_info['u_name']) ? $dist_info['u_name'] : $order_info['u_name'];
$order_info['u_tel']=!empty($dist_info['u_tel']) ? $dist_info['u_tel'] : $order_info['u_tel'];
$order_info['u_add']=!empty($dist_info['u_add']) ? $dist_info['u_add'] : $order_info['u_add'];
$order_info['deliver_time']=!empty($dist_info['deliver_time']) ? $dist_info['deliver_time'] : $order_info['deliver_time'];
}
foreach($goods_info as $v){//计算出总价
$order_info['z_sum']+=$v['z_sum'];
}
......@@ -249,7 +285,7 @@ class ApiOrderController extends Controller
private function getGroupDist($order_num,$county){
$order=M('order');
$order_info=$order->where('order_num="'.$order_num.'"')
->field('yi_order.id,goods_id,group_id,z_sum')
->field('yi_order.id,goods_id,group_id,z_sum,g_sum,cou_sum')
->join('yi_order_goods og on yi_order.id=og.order_id')
->find();
if(!$order_info){return 201;}
......@@ -379,7 +415,7 @@ class ApiOrderController extends Controller
$order_goods->where('order_id='.$order_info['id'])->data('status=4')->save();
$uid=$order_info['uid'];
$title='收货提醒';
$content='尊敬的'.$order_info['u_name'].'(先生/女士)您好,您订单号为('.$_GET['order_num'].')的订单,已经完成交易,感谢您的对易和仓淘的支持,谢谢!';
$content='尊敬的'.$order_info['u_name'].'(先生/女士)您好,您订单号为('.$_GET['order_num'].')的订单,已经完成交易,感谢您的对宅家有购的支持,谢谢!';
addAdv($uid,$title,$content);//发送平台消息
echo json2(200,'success','收货成功');
}else{
......
......@@ -101,13 +101,15 @@ class ApiUserController extends Controller
}
$approve = M('approve');
$rows = $approve->where('u_id=' . $_GET['uid'])
->field('yi_approve.id,u_id,shop_name,s_name,s_tel,s_sex,s_eg,province,city,county,detail,shop_img,status,a1.name province_name,a2.name city_name,a3.name county_name')
->field('yi_approve.id,u_id,shop_name,s_name,s_tel,s_sex,s_eg,province,city,county,detail,shop_img,status,a1.name province_name,a2.name city_name,a3.name county_name, business_license, contract')
->join('yi_area a1 on yi_approve.province=a1.id')
->join('yi_area a2 on yi_approve.city=a2.id')
->join('yi_area a3 on yi_approve.county=a3.id')
->find();
if($rows){
$rows['shop_img'] = get_picture_list($rows['shop_img'],'abs');
$rows['business_license'] = get_picture_list($rows['business_license'],'abs');
$rows['contract'] = get_picture_list($rows['contract'],'abs');
echo json(200, '获取成功!', $rows);
}else {
echo json(400, '数据不存在', 'error');
......@@ -217,4 +219,11 @@ class ApiUserController extends Controller
echo json2(400,'默认地址为空',null);
}
}
public function getXieY()
{
$xie=M('xie');
$info=$xie->find();
echo $info['content'];
}
}
<?php
/*
* Copyright (c) 2014 The CCP project authors. All Rights Reserved.
*
* Use of this source code is governed by a Beijing Speedtong Information Technology Co.,Ltd license
* that can be found in the LICENSE file in the root of the web site.
*
* http://www.yuntongxun.com
*
* An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
class REST {
private $AccountSid;
private $AccountToken;
private $AppId;
private $SubAccountSid;
private $SubAccountToken;
private $ServerIP;
private $ServerPort;
private $SoftVersion;
private $Batch; //时间sh
private $BodyType = "xml";//包体格式,可填值:json 、xml
private $enabeLog = true; //日志开关。可填值:true、
private $Filename="../log.txt"; //日志文件
private $Handle;
function __construct($ServerIP,$ServerPort,$SoftVersion)
{
$this->Batch = date("YmdHis");
$this->ServerIP = $ServerIP;
$this->ServerPort = $ServerPort;
$this->SoftVersion = $SoftVersion;
$this->Handle = fopen($this->Filename, 'a');
}
/**
* 设置主帐号
*
* @param AccountSid 主帐号
* @param AccountToken 主帐号Token
*/
function setAccount($AccountSid,$AccountToken){
$this->AccountSid = $AccountSid;
$this->AccountToken = $AccountToken;
}
/**
* 设置子帐号
*
* @param SubAccountSid 子帐号
* @param SubAccountToken 子帐号Token
*/
function setSubAccount($SubAccountSid,$SubAccountToken){
$this->SubAccountSid = $SubAccountSid;
$this->SubAccountToken = $SubAccountToken;
}
/**
* 设置应用ID
*
* @param AppId 应用ID
*/
function setAppId($AppId){
$this->AppId = $AppId;
}
/**
* 打印日志
*
* @param log 日志内容
*/
function showlog($log){
if($this->enabeLog){
fwrite($this->Handle,$log."\n");
}
}
/**
* 发起HTTPS请求
*/
function curl_post($url,$data,$header,$post=1)
{
//初始化curl
$ch = curl_init();
//参数设置
$res= curl_setopt ($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, $post);
if($post)
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch,CURLOPT_HTTPHEADER,$header);
$result = curl_exec ($ch);
//连接失败
if($result == FALSE){
if($this->BodyType=='json'){
$result = "{\"statusCode\":\"172001\",\"statusMsg\":\"网络错误\"}";
} else {
$result = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Response><statusCode>172001</statusCode><statusMsg>网络错误</statusMsg></Response>";
}
}
curl_close($ch);
return $result;
}
/**
* 创建子帐号
* @param friendlyName 子帐号名称
*/
function createSubAccount($friendlyName)
{
//主帐号鉴权信息验证,对必选参数进行判空。
$auth=$this->accAuth();
if($auth!=""){
return $auth;
}
// 拼接请求包体
if($this->BodyType=="json"){
$body= "{'appId':'$this->AppId','friendlyName':'$friendlyName'}";
}else{
$body="<SubAccount>
<appId>$this->AppId</appId>
<friendlyName>$friendlyName</friendlyName>
</SubAccount>";
}
$this->showlog("request body = ".$body);
// 大写的sig参数
$sig = strtoupper(md5($this->AccountSid . $this->AccountToken . $this->Batch));
// 生成请求URL
$url="https://$this->ServerIP:$this->ServerPort/$this->SoftVersion/Accounts/$this->AccountSid/SubAccounts?sig=$sig";
$this->showlog("request url = ".$url);
// 生成授权:主帐号Id + 英文冒号 + 时间戳
$authen = base64_encode($this->AccountSid . ":" . $this->Batch);
// 生成包头
$header = array("Accept:application/$this->BodyType","Content-Type:application/$this->BodyType;charset=utf-8","Authorization:$authen");
// 发请求
$result = $this->curl_post($url,$body,$header);
$this->showlog("response body = ".$result);
if($this->BodyType=="json"){//JSON格式
$datas=json_decode($result);
}else{ //xml格式
$datas = simplexml_load_string(trim($result," \t\n\r"));
}
// if($datas == FALSE){
// $datas = new stdClass();
// $datas->statusCode = '172003';
// $datas->statusMsg = '返回包体错误';
// }
return $datas;
}
/**
* 获取子帐号
* @param startNo 开始的序号,默认从0开始
* @param offset 一次查询的最大条数,最小是1条,最大是100条
*/
function getSubAccounts($startNo,$offset)
{
//主帐号鉴权信息验证,对必选参数进行判空。
$auth=$this->accAuth();
if($auth!=""){
return $auth;
}
// 拼接请求包体
$body="
<SubAccount>
<appId>$this->AppId</appId>
<startNo>$startNo</startNo>
<offset>$offset</offset>
</SubAccount>";
if($this->BodyType=="json"){
$body= "{'appId':'$this->AppId','startNo':'$startNo','offset':'$offset'}";
}else{
$body="
<SubAccount>
<appId>$this->AppId</appId>
<startNo>$startNo</startNo>
<offset>$offset</offset>
</SubAccount>";
}
$this->showlog("request body = ".$body);
// 大写的sig参数
$sig = strtoupper(md5($this->AccountSid . $this->AccountToken . $this->Batch));
// 生成请求URL
$url="https://$this->ServerIP:$this->ServerPort/$this->SoftVersion/Accounts/$this->AccountSid/GetSubAccounts?sig=$sig";
$this->showlog("request url = ".$url);
// 生成授权:主帐户Id + 英文冒号 + 时间戳。
$authen = base64_encode($this->AccountSid . ":" . $this->Batch);
// 生成包头
$header = array("Accept:application/$this->BodyType","Content-Type:application/$this->BodyType;charset=utf-8","Authorization:$authen");
// 发送请求
$result = $this->curl_post($url,$body,$header);
$this->showlog("response body = ".$result);
if($this->BodyType=="json"){//JSON格式
$datas=json_decode($result);
}else{ //xml格式
$datas = simplexml_load_string(trim($result," \t\n\r"));
}
// if($datas == FALSE){
// $datas = new stdClass();
// $datas->statusCode = '172003';
// $datas->statusMsg = '返回包体错误';
// }
return $datas;
}
/**
* 子帐号信息查询
* @param friendlyName 子帐号名称
*/
function querySubAccount($friendlyName)
{
//主帐号鉴权信息验证,对必选参数进行判空。
$auth=$this->accAuth();
if($auth!=""){
return $auth;
}
// 拼接请求包体
if($this->BodyType=="json"){
$body= "{'appId':'$this->AppId','friendlyName':'$friendlyName'}";
}else{
$body="
<SubAccount>
<appId>$this->AppId</appId>
<friendlyName>$friendlyName</friendlyName>
</SubAccount>";
}
$this->showlog("request body = ".$body);
// 大写的sig参数
$sig = strtoupper(md5($this->AccountSid . $this->AccountToken . $this->Batch));
// 生成请求URL
$url="https://$this->ServerIP:$this->ServerPort/$this->SoftVersion/Accounts/$this->AccountSid/QuerySubAccountByName?sig=$sig";
$this->showlog("request url = ".$url);
// 生成授权:主帐户Id + 英文冒号 + 时间戳。
$authen = base64_encode($this->AccountSid . ":" . $this->Batch);
// 生成包头
$header = array("Accept:application/$this->BodyType","Content-Type:application/$this->BodyType;charset=utf-8","Authorization:$authen");
// 发送请求
$result = $this->curl_post($url,$body,$header);
$this->showlog("response body = ".$result);
if($this->BodyType=="json"){//JSON格式
$datas=json_decode($result);
}else{ //xml格式
$datas = simplexml_load_string(trim($result," \t\n\r"));
}
// if($datas == FALSE){
// $datas = new stdClass();
// $datas->statusCode = '172003';
// $datas->statusMsg = '返回包体错误';
// }
return $datas;
}
/**
* 发送模板短信
* @param to 短信接收彿手机号码集合,用英文逗号分开
* @param datas 内容数据
* @param $tempId 模板Id
*/
function sendTemplateSMS($to,$datas,$tempId)
{
//主帐号鉴权信息验证,对必选参数进行判空。
$auth=$this->accAuth();
if($auth!=""){
return $auth;
}
// 拼接请求包体
if($this->BodyType=="json"){
$data="";
for($i=0;$i<count($datas);$i++){
$data = $data. "'".$datas[$i]."',";
}
$body= "{'to':'$to','templateId':'$tempId','appId':'$this->AppId','datas':[".$data."]}";
}else{
$data="";
for($i=0;$i<count($datas);$i++){
$data = $data. "<data>".$datas[$i]."</data>";
}
$body="<TemplateSMS>
<to>$to</to>
<appId>$this->AppId</appId>
<templateId>$tempId</templateId>
<datas>".$data."</datas>
</TemplateSMS>";
}
$this->showlog("request body = ".$body);
// 大写的sig参数
$sig = strtoupper(md5($this->AccountSid . $this->AccountToken . $this->Batch));
// 生成请求URL
$url="https://$this->ServerIP:$this->ServerPort/$this->SoftVersion/Accounts/$this->AccountSid/SMS/TemplateSMS?sig=$sig";
$this->showlog("request url = ".$url);
// 生成授权:主帐户Id + 英文冒号 + 时间戳。
$authen = base64_encode($this->AccountSid . ":" . $this->Batch);
// 生成包头
$header = array("Accept:application/$this->BodyType","Content-Type:application/$this->BodyType;charset=utf-8","Authorization:$authen");
// 发送请求
$result = $this->curl_post($url,$body,$header);
$this->showlog("response body = ".$result);
if($this->BodyType=="json"){//JSON格式
$datas=json_decode($result);
}else{ //xml格式
$datas = simplexml_load_string(trim($result," \t\n\r"));
}
// if($datas == FALSE){
// $datas = new stdClass();
// $datas->statusCode = '172003';
// $datas->statusMsg = '返回包体错误';
// }
//重新装填数据
if($datas->statusCode==0){
if($this->BodyType=="json"){
$datas->TemplateSMS =$datas->templateSMS;
unset($datas->templateSMS);
}
}
return $datas;
}
/**
* 外呼通知
* @param to 被叫号码
* @param mediaName 语音文件名称,格式 wav。与mediaTxt不能同时为空。当不为空时mediaTxt属性失效。
* @param mediaTxt 文本内容
* @param displayNum 显示的主叫号码
* @param playTimes 循环播放次数,1-3次,默认播放1次。
* @param respUrl 外呼通知状态通知回调地址,云通讯平台将向该Url地址发送呼叫结果通知。
* @param userData 用户私有数据
* @param maxCallTime 最大通话时长
* @param speed 发音速度
* @param volume 音量
* @param pitch 音调
* @param bgsound 背景音编号
*/
function landingCall($to,$mediaName,$mediaTxt,$displayNum,$playTimes,$respUrl,$userData,$maxCallTime,$speed,$volume,$pitch,$bgsound)
{
//主帐号鉴权信息验证,对必选参数进行判空。
$auth=$this->accAuth();
if($auth!=""){
return $auth;
}
// 拼接请求包体
if($this->BodyType=="json"){
$body= "{'playTimes':'$playTimes','mediaTxt':'$mediaTxt','mediaName':'$mediaName','to':'$to','appId':'$this->AppId','displayNum':'$displayNum','respUrl':'$respUrl',
'userData':'$userData','maxCallTime':'$maxCallTime','speed':'$speed','volume':'$volume','pitch':'$pitch','bgsound':'$bgsound'}";
}else{
$body="<LandingCall>
<to>$to</to>
<mediaName>$mediaName</mediaName>
<mediaTxt>$mediaTxt</mediaTxt>
<appId>$this->AppId</appId>
<displayNum>$displayNum</displayNum>
<playTimes>$playTimes</playTimes>
<respUrl>$respUrl</respUrl>
<userData>$userData</userData>
<maxCallTime>$maxCallTime</maxCallTime>
<speed>$speed</speed>
<volume>$volume</volume>
<pitch>$pitch</pitch>
<bgsound>$bgsound</bgsound>
</LandingCall>";
}
$this->showlog("request body = ".$body);
// 大写的sig参数
$sig = strtoupper(md5($this->AccountSid . $this->AccountToken . $this->Batch));
// 生成请求URL
$url="https://$this->ServerIP:$this->ServerPort/$this->SoftVersion/Accounts/$this->AccountSid/Calls/LandingCalls?sig=$sig";
$this->showlog("request url = ".$url);
// 生成授权:主帐户Id + 英文冒号 + 时间戳。
$authen = base64_encode($this->AccountSid . ":" . $this->Batch);
// 生成包头
$header = array("Accept:application/$this->BodyType","Content-Type:application/$this->BodyType;charset=utf-8","Authorization:$authen");
// 发送请求
$result = $this->curl_post($url,$body,$header);
$this->showlog("response body = ".$result);
if($this->BodyType=="json"){//JSON格式
$datas=json_decode($result);
}else{ //xml格式
$datas = simplexml_load_string(trim($result," \t\n\r"));
}
// if($datas == FALSE){
// $datas = new stdClass();
// $datas->statusCode = '172003';
// $datas->statusMsg = '返回包体错误';
// }
return $datas;
}
/**
* 语音验证码
* @param verifyCode 验证码内容,为数字和英文字母,不区分大小写,长度4-8位
* @param playTimes 播放次数,1-3次
* @param to 接收号码
* @param displayNum 显示的主叫号码
* @param respUrl 语音验证码状态通知回调地址,云通讯平台将向该Url地址发送呼叫结果通知
* @param lang 语言类型
* @param userData 第三方私有数据
*/
function voiceVerify($verifyCode,$playTimes,$to,$displayNum,$respUrl,$lang,$userData)
{
//主帐号鉴权信息验证,对必选参数进行判空。
$auth=$this->accAuth();
if($auth!=""){
return $auth;
}
// 拼接请求包体
if($this->BodyType=="json"){
$body= "{'appId':'$this->AppId','verifyCode':'$verifyCode','playTimes':'$playTimes','to':'$to','respUrl':'$respUrl','displayNum':'$displayNum',
'lang':'$lang','userData':'$userData'}";
}else{
$body="<VoiceVerify>
<appId>$this->AppId</appId>
<verifyCode>$verifyCode</verifyCode>
<playTimes>$playTimes</playTimes>
<to>$to</to>
<respUrl>$respUrl</respUrl>
<displayNum>$displayNum</displayNum>
<lang>$lang</lang>
<userData>$userData</userData>
</VoiceVerify>";
}
$this->showlog("request body = ".$body);
// 大写的sig参数
$sig = strtoupper(md5($this->AccountSid . $this->AccountToken . $this->Batch));
// 生成请求URL
$url="https://$this->ServerIP:$this->ServerPort/$this->SoftVersion/Accounts/$this->AccountSid/Calls/VoiceVerify?sig=$sig";
$this->showlog("request url = ".$url);
// 生成授权:主帐户Id + 英文冒号 + 时间戳。
$authen = base64_encode($this->AccountSid . ":" . $this->Batch);
// 生成包头
$header = array("Accept:application/$this->BodyType","Content-Type:application/$this->BodyType;charset=utf-8","Authorization:$authen");
// 发送请求
$result = $this->curl_post($url,$body,$header);
$this->showlog("response body = ".$result);
if($this->BodyType=="json"){//JSON格式
$datas=json_decode($result);
}else{ //xml格式
$datas = simplexml_load_string(trim($result," \t\n\r"));
}
// if($datas == FALSE){
// $datas = new stdClass();
// $datas->statusCode = '172003';
// $datas->statusMsg = '返回包体错误';
// }
return $datas;
}
/**
* IVR外呼
* @param number 待呼叫号码,为Dial节点的属性
* @param userdata 用户数据,在<startservice>通知中返回,只允许填写数字字符,为Dial节点的属性
* @param record 是否录音,可填项为true和false,默认值为false不录音,为Dial节点的属性
*/
function ivrDial($number,$userdata,$record)
{
//主帐号鉴权信息验证,对必选参数进行判空。
$auth=$this->accAuth();
if($auth!=""){
return $auth;
}
// 拼接请求包体
$body=" <Request>
<Appid>$this->AppId</Appid>
<Dial number='$number' userdata='$userdata' record='$record'></Dial>
</Request>";
$this->showlog("request body = ".$body);
// 大写的sig参数
$sig = strtoupper(md5($this->AccountSid . $this->AccountToken . $this->Batch));
// 生成请求URL
$url="https://$this->ServerIP:$this->ServerPort/$this->SoftVersion/Accounts/$this->AccountSid/ivr/dial?sig=$sig";
$this->showlog("request url = ".$url);
// 生成授权:主帐户Id + 英文冒号 + 时间戳。
$authen = base64_encode($this->AccountSid . ":" . $this->Batch);
// 生成包头
$header = array("Accept:application/xml","Content-Type:application/xml;charset=utf-8","Authorization:$authen");
// 发送请求
$result = $this->curl_post($url,$body,$header);
$this->showlog("response body = ".$result);
$datas = simplexml_load_string(trim($result," \t\n\r"));
// if($datas == FALSE){
// $datas = new stdClass();
// $datas->statusCode = '172003';
// $datas->statusMsg = '返回包体错误';
// }
return $datas;
}
/**
* 话单下载
* @param date day 代表前一天的数据(从00:00 – 23:59)
* @param keywords 客户的查询条件,由客户自行定义并提供给云通讯平台。默认不填忽略此参数
*/
function billRecords($date,$keywords)
{
//主帐号鉴权信息验证,对必选参数进行判空。
$auth=$this->accAuth();
if($auth!=""){
return $auth;
}
// 拼接请求包体
if($this->BodyType=="json"){
$body= "{'appId':'$this->AppId','date':'$date','keywords':'$keywords'}";
}else{
$body="<BillRecords>
<appId>$this->AppId</appId>
<date>$date</date>
<keywords>$keywords</keywords>
</BillRecords>";
}
$this->showlog("request body = ".$body);
// 大写的sig参数
$sig = strtoupper(md5($this->AccountSid . $this->AccountToken . $this->Batch));
// 生成请求URL
$url="https://$this->ServerIP:$this->ServerPort/$this->SoftVersion/Accounts/$this->AccountSid/BillRecords?sig=$sig";
$this->showlog("request url = ".$url);
// 生成授权:主帐户Id + 英文冒号 + 时间戳。
$authen = base64_encode($this->AccountSid . ":" . $this->Batch);
// 生成包头
$header = array("Accept:application/$this->BodyType","Content-Type:application/$this->BodyType;charset=utf-8","Authorization:$authen");
// 发送请求
$result = $this->curl_post($url,$body,$header);
$this->showlog("response body = ".$result);
if($this->BodyType=="json"){//JSON格式
$datas=json_decode($result);
}else{ //xml格式
$datas = simplexml_load_string(trim($result," \t\n\r"));
}
// if($datas == FALSE){
// $datas = new stdClass();
// $datas->statusCode = '172003';
// $datas->statusMsg = '返回包体错误';
// }
return $datas;
}
/**
* 主帐号信息查询
*/
function queryAccountInfo()
{
//主帐号鉴权信息验证,对必选参数进行判空。
$auth=$this->accAuth();
if($auth!=""){
return $auth;
}
// 大写的sig参数
$sig = strtoupper(md5($this->AccountSid . $this->AccountToken . $this->Batch));
// 生成请求URL
$url="https://$this->ServerIP:$this->ServerPort/$this->SoftVersion/Accounts/$this->AccountSid/AccountInfo?sig=$sig";
$this->showlog("request url = ".$url);
// 生成授权:主帐户Id + 英文冒号 + 时间戳。
$authen = base64_encode($this->AccountSid . ":" . $this->Batch);
// 生成包头
$header = array("Accept:application/$this->BodyType","Content-Type:application/$this->BodyType;charset=utf-8","Authorization:$authen");
// 发送请求
$result = $this->curl_post($url,"",$header,0);
$this->showlog("response body = ".$result);
if($this->BodyType=="json"){//JSON格式
$datas=json_decode($result);
}else{ //xml格式
$datas = simplexml_load_string(trim($result," \t\n\r"));
}
// if($datas == FALSE){
// $datas = new stdClass();
// $datas->statusCode = '172003';
// $datas->statusMsg = '返回包体错误';
// }
return $datas;
}
/**
* 短信模板查询
* @param date templateId 模板ID
*/
function QuerySMSTemplate($templateId)
{
//主帐号鉴权信息验证,对必选参数进行判空。
$auth=$this->accAuth();
if($auth!=""){
return $auth;
}
// 拼接请求包体
if($this->BodyType=="json"){
$body= "{'appId':'$this->AppId','templateId':'$templateId'}";
}else{
$body="<Request>
<appId>$this->AppId</appId>
<templateId>$templateId</templateId>
</Request>";
}
$this->showlog("request body = ".$body);
// 大写的sig参数
$sig = strtoupper(md5($this->AccountSid . $this->AccountToken . $this->Batch));
// 生成请求URL
$url="https://$this->ServerIP:$this->ServerPort/$this->SoftVersion/Accounts/$this->AccountSid/SMS/QuerySMSTemplate?sig=$sig";
$this->showlog("request url = ".$url);
// 生成授权:主帐户Id + 英文冒号 + 时间戳。
$authen = base64_encode($this->AccountSid . ":" . $this->Batch);
// 生成包头
$header = array("Accept:application/$this->BodyType","Content-Type:application/$this->BodyType;charset=utf-8","Authorization:$authen");
// 发送请求
$result = $this->curl_post($url,$body,$header);
$this->showlog("response body = ".$result);
if($this->BodyType=="json"){//JSON格式
$datas=json_decode($result);
}else{ //xml格式
$datas = simplexml_load_string(trim($result," \t\n\r"));
}
// if($datas == FALSE){
// $datas = new stdClass();
// $datas->statusCode = '172003';
// $datas->statusMsg = '返回包体错误';
// }
return $datas;
}
/**
* 呼叫状态查询
* @param callid 呼叫Id
* @param action 查询结果通知的回调url地址
*/
function QueryCallState($callid,$action)
{
//主帐号鉴权信息验证,对必选参数进行判空。
$auth=$this->accAuth();
if($auth!=""){
return $auth;
}
// 拼接请求包体
if($this->BodyType=="json"){
$body= "{'Appid':'$this->AppId','QueryCallState':{'callid':'$callid','action':'$action'}}";
}else{
$body="<Request>
<Appid>$this->AppId</Appid>
<QueryCallState callid ='$callid' action='$action'/>
</Request>";
}
$this->showlog("request body = ".$body);
// 大写的sig参数
$sig = strtoupper(md5($this->AccountSid . $this->AccountToken . $this->Batch));
// 生成请求URL
$url="https://$this->ServerIP:$this->ServerPort/$this->SoftVersion/Accounts/$this->AccountSid/ivr/call?sig=$sig&callid=$callid";
$this->showlog("request url = ".$url);
// 生成授权:主帐户Id + 英文冒号 + 时间戳。
$authen = base64_encode($this->AccountSid . ":" . $this->Batch);
// 生成包头
$header = array("Accept:application/$this->BodyType","Content-Type:application/$this->BodyType;charset=utf-8","Authorization:$authen");
// 发送请求
$result = $this->curl_post($url,$body,$header);
$this->showlog("response body = ".$result);
if($this->BodyType=="json"){//JSON格式
$datas=json_decode($result);
}else{ //xml格式
$datas = simplexml_load_string(trim($result," \t\n\r"));
}
// if($datas == FALSE){
// $datas = new stdClass();
// $datas->statusCode = '172003';
// $datas->statusMsg = '返回包体错误';
// }
return $datas;
}
/**
* 呼叫结果查询
* @param callSid 呼叫Id
*/
function CallResult($callSid)
{
//主帐号鉴权信息验证,对必选参数进行判空。
$auth=$this->accAuth();
if($auth!=""){
return $auth;
}
// 大写的sig参数
$sig = strtoupper(md5($this->AccountSid . $this->AccountToken . $this->Batch));
// 生成请求URL
$url="https://$this->ServerIP:$this->ServerPort/$this->SoftVersion/Accounts/$this->AccountSid/CallResult?sig=$sig&callsid=$callSid";
$this->showlog("request url = ".$url);
// 生成授权:主帐户Id + 英文冒号 + 时间戳。
$authen = base64_encode($this->AccountSid . ":" . $this->Batch);
// 生成包头
$header = array("Accept:application/$this->BodyType","Content-Type:application/$this->BodyType;charset=utf-8","Authorization:$authen");
// 发送请求
$result = $this->curl_post($url,"",$header,0);
$this->showlog("response body = ".$result);
if($this->BodyType=="json"){//JSON格式
$datas=json_decode($result);
}else{ //xml格式
$datas = simplexml_load_string(trim($result," \t\n\r"));
}
// if($datas == FALSE){
// $datas = new stdClass();
// $datas->statusCode = '172003';
// $datas->statusMsg = '返回包体错误';
// }
return $datas;
}
/**
* 语音文件上传
* @param filename 文件名
* @param body 二进制串
*/
function MediaFileUpload($filename,$body)
{
//主帐号鉴权信息验证,对必选参数进行判空。
$auth=$this->accAuth();
if($auth!=""){
return $auth;
}
// 拼接请求包体
$this->showlog("request body = ".$body);
// 大写的sig参数
$sig = strtoupper(md5($this->AccountSid . $this->AccountToken . $this->Batch));
// 生成请求URL
$url="https://$this->ServerIP:$this->ServerPort/$this->SoftVersion/Accounts/$this->AccountSid/Calls/MediaFileUpload?sig=$sig&appid=$this->AppId&filename=$filename";
$this->showlog("request url = ".$url);
// 生成授权:主帐户Id + 英文冒号 + 时间戳。
$authen = base64_encode($this->AccountSid . ":" . $this->Batch);
// 生成包头
$header = array("Accept:application/$this->BodyType","Content-Type:application/octet-stream","Authorization:$authen");
// 发送请求
$result = $this->curl_post($url,$body,$header);
$this->showlog("response body = ".$result);
if($this->BodyType=="json"){//JSON格式
$datas=json_decode($result);
}else{ //xml格式
$datas = simplexml_load_string(trim($result," \t\n\r"));
}
// if($datas == FALSE){
// $datas = new stdClass();
// $datas->statusCode = '172003';
// $datas->statusMsg = '返回包体错误';
// }
return $datas;
}
/**
* 子帐号鉴权
*/
function subAuth()
{
if($this->ServerIP==""){
$data = new stdClass();
$data->statusCode = '172004';
$data->statusMsg = 'serverIP为空';
return $data;
}
if($this->ServerPort<=0){
$data = new stdClass();
$data->statusCode = '172005';
$data->statusMsg = '端口错误(小于等于0)';
return $data;
}
if($this->SoftVersion==""){
$data = new stdClass();
$data->statusCode = '172013';
$data->statusMsg = '版本号为空';
return $data;
}
if($this->SubAccountSid==""){
$data = new stdClass();
$data->statusCode = '172008';
$data->statusMsg = '子帐号为空';
return $data;
}
if($this->SubAccountToken==""){
$data = new stdClass();
$data->statusCode = '172009';
$data->statusMsg = '子帐号令牌为空';
return $data;
}
if($this->AppId==""){
$data = new stdClass();
$data->statusCode = '172012';
$data->statusMsg = '应用ID为空';
return $data;
}
}
/**
* 主帐号鉴权
*/
function accAuth()
{
if($this->ServerIP==""){
$data = new stdClass();
$data->statusCode = '172004';
$data->statusMsg = 'serverIP为空';
return $data;
}
if($this->ServerPort<=0){
$data = new stdClass();
$data->statusCode = '172005';
$data->statusMsg = '端口错误(小于等于0)';
return $data;
}
if($this->SoftVersion==""){
$data = new stdClass();
$data->statusCode = '172013';
$data->statusMsg = '版本号为空';
return $data;
}
if($this->AccountSid==""){
$data = new stdClass();
$data->statusCode = '172006';
$data->statusMsg = '主帐号为空';
return $data;
}
if($this->AccountToken==""){
$data = new stdClass();
$data->statusCode = '172007';
$data->statusMsg = '主帐号令牌为空';
return $data;
}
if($this->AppId==""){
$data = new stdClass();
$data->statusCode = '172012';
$data->statusMsg = '应用ID为空';
return $data;
}
}
}
?>
......@@ -102,7 +102,7 @@ class CenterController extends HomeController{
$order_goods->where('order_id='.$order_info['id'])->data('status=4')->save();
$uid=$order_info['uid'];
$title='收货提醒';
$content='尊敬的'.$order_info['u_name'].'(先生/女士)您好,您订单号为('.$_GET['order_num'].')的订单,已经完成交易,感谢您的对易和仓淘的支持,谢谢!';
$content='尊敬的'.$order_info['u_name'].'(先生/女士)您好,您订单号为('.$_GET['order_num'].')的订单,已经完成交易,感谢您的对宅家有购的支持,谢谢!';
addAdv($uid,$title,$content);//发送平台消息
$this->success('收货成功',U('Center/order'));
}else{
......
......@@ -214,29 +214,20 @@ class PublicController extends Controller{
$verify = rand(123456, 999999);//获取随机验证码
//以下信息自己填以下
$mobile=$_GET['tel'];//手机号
$argv = array(
'name'=>'15982155557', //必填参数。用户账号
'pwd'=>'DC4F2D967EF1BC7095303187B521', //必填参数。(web平台:基本资料中的接口密码)
'content'=>'短信验证码为:'.$verify.',请勿将验证码提供给他人。请在3分钟内进行验证。', //必填参数。发送内容(1-500 个汉字)UTF-8编码
'mobile'=>$mobile, //必填参数。手机号码。多个以英文逗号隔开
'stime'=>'', //可选参数。发送时间,填写时已填写的时间发送,不填时为当前时间发送
'sign'=>'易和仓淘', //必填参数。用户签名。
'type'=>'pt', //必填参数。固定值 pt
'extno'=>'' //可选参数,扩展码,用户定义扩展码,只能为数字
);
include __DIR__ . '/CCPRestSDK.php';
//主帐号
$accountSid= '8a216da8701eb7c101702e0f20b90475';
$accountToken= '5b64528817344a8fa8d7d0b6db7c1818';
$appId='8a216da8701eb7c101702e0f2115047b';
$serverIP='app.cloopen.com';
$serverPort='8883';
$softVersion='2013-12-26';
$rest = new \REST($serverIP,$serverPort,$softVersion);
$rest->setAccount($accountSid,$accountToken);
$rest->setAppId($appId);
$result = $rest->sendTemplateSMS($mobile,[$verify, 5],'577306');
foreach ($argv as $key=>$value) {
if ($flag!=0) {
$params .= "&";
$flag = 1;
}
$params.= $key."="; $params.= urlencode($value);// urlencode($value);
$flag = 1;
}
$url = "http://web.cr6868.com/asmx/smsservice.aspx?".$params; //提交的url地址
$msg=file_get_contents($url);
$con= substr( $msg, 0, 1 ); //获取信息发送后的状态
if($con == '0'){
if($result->statusCode == '000000'){
$sms=M('sms');
$data['code']=$verify;
$data['time']=time();
......@@ -248,14 +239,8 @@ class PublicController extends Controller{
$sms->data($data)->add();
}
echo json(200,'success','短信请求成功!');
}elseif($con=='2'){
echo json(402,'error','账户余额不足');
}elseif($con==1){
echo json(401,'error','平台账户密码有误');
}elseif($con=='3'){
echo json(403,'error','不是有效号码');
}else{
echo json(400,'error','获取失败!请稍后在试');
echo json(400,'error',$result->statusMsg);
}
}
//获取广告详情
......
......@@ -16,7 +16,7 @@ class WxpayController extends Controller{
$wx = new WxpayModel();//实例化微信支付控制器
$body ='感谢使用易和仓淘';//支付说明
$body ='感谢使用宅家有购';//支付说明
$out_trade_no = $tsk['order_num'];//订单号
......@@ -67,8 +67,8 @@ class WxpayController extends Controller{
if($find){
$input = new \WxPayUnifiedOrder();
$input->SetBody("感谢使用易和仓淘");
$input->SetAttach("感谢使用易和仓淘");
$input->SetBody("感谢使用宅家有购");
$input->SetAttach("感谢使用宅家有购");
$input->SetOut_trade_no($tsk['order_num']);
$input->SetTotal_fee("1");
$input->SetTime_start(date("YmdHis"));
......
......@@ -6,7 +6,7 @@
<div class="WDxiaox_tit">服务消息</div>
<volist name='info' id='v'>
<div class="WDxiaox_con">
<div class="h5"><a href="{:U('Center/xtxxInfo',array('id'=>$v['id']))}">易和仓淘:{$v.title}</a><eq name="v.status" value="1"><font color="red">未读</font><else/><font color="green">已读</font></eq></div>
<div class="h5"><a href="{:U('Center/xtxxInfo',array('id'=>$v['id']))}">宅家有购:{$v.title}</a><eq name="v.status" value="1"><font color="red">未读</font><else/><font color="green">已读</font></eq></div>
<div class="pic">
<div class="ddh">{$v.time|date="Y-m-d h:i:s",###}</div>
<div class="ddh"><a href="{:U('Center/xtxxInfo',array('id'=>$v['id']))}">去看看</a><eq name="v.status" value="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a style="color: red;" href="{:U('Center/xtxxD',array('id'=>$v['id']))}">删除</a></eq></div>
......
......@@ -5,7 +5,7 @@
<div class="WDxiaox fr">
<div class="WDxiaox_tit">服务消息</div>
<div class="WDxiaox_con">
<div class="h5">易和仓淘:{$info.title}<eq name="v.status" value="1"><font color="red">未读</font><else/><font color="green">已读--</font><a style="color: red;" href="{:U('Center/xtxxD',array('id'=>$info['id']))}">删除</a></eq></div>
<div class="h5">宅家有购:{$info.title}<eq name="v.status" value="1"><font color="red">未读</font><else/><font color="green">已读--</font><a style="color: red;" href="{:U('Center/xtxxD',array('id'=>$info['id']))}">删除</a></eq></div>
<div class="pic">
<div class="ddh">{$info.content}</div>
<div class="ddh"></div>
......
......@@ -5,7 +5,7 @@
<include file="Center/leftmenu"/>
<div class="GRXX_r fr">
<form action="{:U('Center/yjfk')}" method="post" id="yjfk">
<div class="yhfk-tit">易和仓淘用户反馈</div>
<div class="yhfk-tit">宅家有购用户反馈</div>
<div class="yhfk-p">亲爱的用户,请将你使用后的意见和建议告诉我们,以便我们更好的改进产品,为您提供更好的服务。谢谢您的支持</div>
<div class="fhfk-yj">
<div class="tit">1、您使用“当前页面”时,遇到任何问题、意见或建议,请告诉我们</div>
......
......@@ -62,7 +62,7 @@
<div class="ind_Ut_l fl"><img src="__IMG__/logo_02.png" height="50"></div>
<div class="ind_Ut_r fl">
<div class="t1">未登录!请登录</div>
<div class="t2">欢迎来到易和仓淘</div>
<div class="t2">欢迎来到宅家有购</div>
</div>
</div>
<div class="btn name">
......@@ -74,7 +74,7 @@
<div class="ind_Ut_l fl"><empty name="facePath"><img src="__IMG__/logo_02.png" height="50"><else/><img src="{$facePath}" height="50"></empty></div>
<div class="ind_Ut_r fl">
<div class="t1">嗨!您好<br/>{$Think.session.user_id|get_user}</div>
<div class="t2">欢迎来到易和仓淘</div>
<div class="t2">欢迎来到宅家有购</div>
</div>
</div>
<div class="btn name">
......
......@@ -118,7 +118,7 @@
<input type="hidden" name="now" value="1" id="now">
<input type="hidden" name="gid" value="{$info.id}" id="gid">
</div>
<div class="ps">温馨提示:本产品由易和仓淘发货<a href="{:U('Article/peisong')}" target="_blank">《配送说明》</a></div>
<div class="ps">温馨提示:本产品由宅家有购发货<a href="{:U('Article/peisong')}" target="_blank">《配送说明》</a></div>
</div>
</div>
</form>
......
......@@ -3,7 +3,7 @@
<div class="pubox">
<div class="phone fl">
<img src="__IMG__/dh_top3.png">
<a href="{:U('Article/xiazai')}" class="color-da">手机逛易和仓淘</a>
<a href="{:U('Article/xiazai')}" class="color-da">手机逛宅家有购</a>
</div>
<div class="home fl">
<img src="__IMG__/dh_top1.png">
......
......@@ -85,7 +85,7 @@
<div class="danx" style="height:16px; line-height: 16px;">
<input type="checkbox" value='1' name='tongyi' id='tongyi' class="fl">同意
<a href="{:U('Article/xieyi',array('type'=>'3'))}" target="_blank">易和仓淘服务协议》</a>
<a href="{:U('Article/xieyi',array('type'=>'3'))}" target="_blank">宅家有购服务协议》</a>
</div>
<a href="javascript:;" class="xiayibu">下一步</a>
</form>
......
......@@ -15,7 +15,7 @@
define('UC_APP_ID', 1); //应用ID
define('UC_API_TYPE', 'Model'); //可选值 Model / Service
define('UC_AUTH_KEY', 'hS1nQ$:i,|y[}*-+XKDFsP~_Z3TR=;o7Ok{IJU6z'); //加密KEY
//define('UC_DB_DSN', 'mysqli://root:@localhost:3306/bds'); // 数据库连接,使用Model方式调用API必须配置此项
define('UC_DB_DSN', 'mysqli://root:e8T4u3to2GurjjEH@47.108.181.205:3306/bds'); // 数据库连接,使用Model方式调用API必须配置此项
define('UC_DB_DSN', 'mysqli://root:@localhost:3306/bds'); // 数据库连接,使用Model方式调用API必须配置此项
//define('UC_DB_DSN', 'mysqli://root:e8T4u3to2GurjjEH@47.108.181.205:3306/bds'); // 数据库连接,使用Model方式调用API必须配置此项
define('UC_TABLE_PREFIX', 'yi_'); // 数据表前缀,使用Model方式调用API必须配置此项
......@@ -136,7 +136,8 @@ return array(
'URL_MODEL' => 1, // URL访问模式,可选参数0、1、2、3,代表以下四种模式:
// 0 (普通模式); 1 (PATHINFO 模式); 2 (REWRITE 模式); 3 (兼容模式) 默认为PATHINFO 模式
'URL_PATHINFO_DEPR' => '/', // PATHINFO模式下,各参数之间的分割符号
'URL_PATHINFO_FETCH' => 'ORIG_PATH_INFO,REDIRECT_PATH_INFO,REDIRECT_URL', // 用于兼容判断PATH_INFO 参数的SERVER替代变量列表
// 'URL_PATHINFO_FETCH' => 'ORIG_PATH_INFO,REDIRECT_PATH_INFO,REDIRECT_URL', // 用于兼容判断PATH_INFO 参数的SERVER替代变量列表
'pathinfo_fetch' => ['ORIG_PATH_INFO', 'REDIRECT_PATH_INFO', 'REDIRECT_URL', 'REQUEST_URI'],
'URL_REQUEST_URI' => 'REQUEST_URI', // 获取当前页面地址的系统变量 默认为REQUEST_URI
'URL_HTML_SUFFIX' => 'html', // URL伪静态后缀设置
'URL_DENY_SUFFIX' => 'ico|png|gif|jpg', // URL禁止访问的后缀设置
......
......@@ -20,8 +20,8 @@ class WxPayConf_pub
//=======【证书路径设置】=====================================
//证书路径,注意应该填写绝对路径
const SSLCERT_PATH = 'D:/phpStudy/WWW/yhct/apiclient_cert.pem';
const SSLKEY_PATH = 'D:/phpStudy/WWW/yhct/apiclient_key.pem';
const SSLCERT_PATH = __DIR__ . '/cacert/apiclient_cert.pem';
const SSLKEY_PATH = __DIR__ . '/cacert/apiclient_key.pem';
//=======【异步通知url设置】===================================
//异步通知url,商户根据实际开发过程设定
......
......@@ -34,8 +34,8 @@ class WxPayConfig
* API证书下载地址:https://pay.weixin.qq.com/index.php/account/api_cert,下载之前需要安装商户操作证书)
* @var path
*/
const SSLCERT_PATH = 'D:/phpStudy/WWW/yhct/apiclient_cert.pem';
const SSLKEY_PATH = 'D:/phpStudy/WWW/yhct/apiclient_key.pem';
const SSLCERT_PATH = __DIR__ . '/cacert/apiclient_cert.pem';
const SSLKEY_PATH = __DIR__ . '/cacert/apiclient_key.pem';
//=======【curl代理设置】===================================
/**
......
a.jpg

2.38 MB

<?php
// +----------------------------------------------------------------------
// | OneThink [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.onethink.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: 麦当苗儿 <zuojiazi@vip.qq.com> <http://www.zjzit.cn>
// +----------------------------------------------------------------------
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
die('require PHP > 5.3.0 !');
}
/**
* 系统调试设置
* 项目正式部署后请设置为false
*/
define('APP_DEBUG', true);
/**
* 应用目录设置
* 安全期间,建议安装调试完成后移动到非WEB目录
*/
define('APP_PATH', './Application/');
if (!is_file(APP_PATH . 'User/Conf/config.php')) {
header('Location: ./install.php');
exit;
}
/**
* 缓存目录设置
* 此目录必须可写,建议移动到非WEB目录
*/
define('RUNTIME_PATH', './Runtime/');
define('DEFAULT_MODULE', 'Admin');
/**
* 引入核心入口
* ThinkPHP亦可移动到WEB以外的目录
*/
require './ThinkPHP/ThinkPHP.php';
......@@ -56,12 +56,12 @@ $trade_no = $_POST['trade_no'];
$trade_status = $_POST['trade_status'];
error_log($s,3,'111.log');
$time = time();
$link = mysql_connect($config['DB_HOST'], $config['DB_USER'], $config['DB_PWD']);
$link = mysqli_connect($config['DB_HOST'], $config['DB_USER'], $config['DB_PWD']);
if (!$link) {
error_log('数据库连接失败', 3, 'db_content.log');
}
mysql_select_db($config['DB_NAME']);
mysql_query("SET BAMES UTF8");
mysqli_select_db($config['DB_NAME']);
mysqli_query("SET BAMES UTF8");
$table1 = $config['DB_PREFIX'] . 'order';//订单
$table2 = $config['DB_PREFIX'] . 'order_goods';//订单商品
$table3 = $config['DB_PREFIX'] . 'order_invo';//发票
......@@ -75,25 +75,25 @@ error_log($config,3,'cons.log');
$msg=strpos($out_trade_no,'i');
if($msg){//存在i 则判断为发票订单
$sql="UPDATE {$table3} SET status=2 where invo_num='{$out_trade_no}'";
mysql_query($sql);
mysqli_query($sql);
$sql11='select id from '.$table3.' where invo_num="'.$out_trade_no.'"';
$rows=mysql_query($sql11);
$id=mysql_fetch_array($rows,MYSQL_ASSOC );
$rows=mysqli_query($sql11);
$id=mysqli_fetch_array($rows,MYSQLI_ASSOC );
$sq2 = "UPDATE {$table4} SET status=2 where invo_id=".$id['id'];
mysql_query($sq2);
mysqli_query($sq2);
}else{//商品订单
$infoSql = 'select order_type from '.$table1.' where order_num="'.$out_trade_no.'"';
$infoRows=mysql_query($infoSql);
$info=mysql_fetch_array($infoRows,MYSQL_ASSOC );
$infoRows=mysqli_query($infoSql);
$info=mysqli_fetch_array($infoRows,MYSQLI_ASSOC );
if ($info['order_type'] == 1) {
//设置订单为已经支付
$sql = "UPDATE {$table1} SET order_type=2 where order_num='{$out_trade_no}'";
$sql11='select id from '.$table1.' where order_num="'.$out_trade_no.'"';
mysql_query($sql);
$rows=mysql_query($sql11);
$id=mysql_fetch_array($rows,MYSQL_ASSOC );
mysqli_query($sql);
$rows=mysqli_query($sql11);
$id=mysqli_fetch_array($rows,MYSQLI_ASSOC );
$sq2 = "UPDATE {$table2} SET status=2 where order_id=".$id['id'];
mysql_query($sq2);
mysqli_query($sq2);
//调试用,写文本函数记录程序运行情况是否正常
writeLog("$sql", "TRADE_SUCCESS.log");
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -31,6 +31,8 @@ if(!is_file(APP_PATH . 'User/Conf/config.php')){
*/
define ( 'RUNTIME_PATH', './Runtime/' );
define('DEFAULT_MODULE','Home');
/**
* 引入核心入口
* ThinkPHP亦可移动到WEB以外的目录
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>宅家有购</title>
<style>
body,ol,ul,h1,h2,h3,h4,h5,h6,p,th,td,dl,dd,form,fieldset,legend,input,textarea,select{margin:0;padding:0}
body{font:12px"宋体","Arial Narrow",HELVETICA;background:#fff;-webkit-text-size-adjust:100%;}
a{color:#2d374b;text-decoration:none}
a:hover{color:#cd0200;text-decoration:underline}
em{font-style:normal}
li{list-style:none}
img{border:0;vertical-align:middle}
table{border-collapse:collapse;border-spacing:0}
p{word-wrap:break-word}
img{
width: 100%;
}
.bgBox{
position: relative;width: 100%;
}
.beian{
position: absolute;left: 50%;
bottom: 20px;
-webkit-transform: translateX(-50%);
-moz-transform: translateX(-50%);
transform: translateX(-50%);
color: #656565;
}
</style>
</head>
<body>
<div class="bgBox">
<img src="/a.jpg">
<a class="beian" href="http://www.beian.miit.gov.cn">蜀ICP备20006621号</a>
</div>
</body>
</html>
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