| xqd
@@ -13,12 +13,17 @@
|
|
|
*/
|
|
|
|
|
|
defined('IN_IA') or exit('Access Denied');
|
|
|
-
|
|
|
+require_once 'init.php';
|
|
|
|
|
|
|
|
|
class Zh_jdgjbModuleWxapp extends WeModuleWxapp {
|
|
|
|
|
|
- public function doPageTest(){
|
|
|
+ public function __construct()
|
|
|
+ {
|
|
|
+ checkOrder();
|
|
|
+ }
|
|
|
+
|
|
|
+ public function doPageTest(){
|
|
|
global $_GPC, $_W;
|
|
|
$errno = 0;
|
|
|
$message = '返回消息';
|
| xqd
@@ -460,7 +465,36 @@ public function doPageReceiveCoupons(){
|
|
|
echo json_encode(['code'=> 1, 'data' => $order_id]);
|
|
|
}
|
|
|
|
|
|
+ public function doPageAddRePayOrder(){
|
|
|
+ global $_W, $_GPC;
|
|
|
+ $data['user_id']=$_GPC['user_id'];
|
|
|
+ $data['order_id']=$_GPC['order_id'];
|
|
|
+ $level = pdo_get('zh_jdgjb_order',array('id' => $_GPC['order_id']));
|
|
|
+ if (!$level) {
|
|
|
+ echo json_encode(['code'=> -1, 'msg' => '该订单不存在']);
|
|
|
+ exit;
|
|
|
+ }
|
|
|
+ if ($level['is_re_pay'] == 1) {
|
|
|
+ echo json_encode(['code'=> -1, 'msg' => '该订单已支付']);
|
|
|
+ exit;
|
|
|
+ }
|
|
|
+ $data['order_no']='R' . date('YmdHis').rand(0,9999);
|
|
|
+ $data['status']=1;
|
|
|
+ $data['time']=time();
|
|
|
+ $data['price']=$level['value'];
|
|
|
+ $data['tel']=$_GPC['tel'];
|
|
|
+ $data['name']=$_GPC['name'];
|
|
|
+ $data['total_cost']=$level['value'];
|
|
|
+ $data['uniacid']=$_W['uniacid'];
|
|
|
+ $data['out_trade_no']='R' . time().rand(1000,9999).$_GPC['user_id'];
|
|
|
+
|
|
|
|
|
|
+ // $data['out_trade_no']=$_GPC['out_trade_no'];//预定订单
|
|
|
+ $data['from_id']=$_GPC['from_id'];
|
|
|
+ $res=pdo_insert('zh_jdgjb_re_order',$data);
|
|
|
+ $order_id=pdo_insertid();
|
|
|
+ echo json_encode(['code'=> 1, 'data' => $order_id]);
|
|
|
+ }
|
|
|
//生成订单
|
|
|
public function doPageAddOrder(){
|
|
|
global $_W, $_GPC;
|
| xqd
@@ -813,11 +847,38 @@ public function doPageMyOrder(){
|
|
|
$select_sql=$sql." LIMIT " .($pageindex - 1) * $pagesize.",".$pagesize;
|
|
|
$list=pdo_fetchall($select_sql,$data);
|
|
|
foreach($list as $key=>$val){
|
|
|
- $list[$key]['count']=pdo_fetchcolumn("SELECT count(*) FROM ".tablename('zh_jdgjb_order') .$where.' and id<='.$val['id'].' and user_id='.$val['user_id'] ,$data)?:0;
|
|
|
-}
|
|
|
+ $list[$key]['count']=pdo_fetchcolumn("SELECT count(*) FROM ".tablename('zh_jdgjb_order') .$where.' and id<='.$val['id'].' and user_id='.$val['user_id'] ,$data)?:0;
|
|
|
+ }
|
|
|
echo json_encode($list);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+//我的订单
|
|
|
+ public function doPageMyOverdueOrder(){
|
|
|
+ global $_GPC, $_W;
|
|
|
+ $pageindex = max(1, intval($_GPC['page']));
|
|
|
+ $pagesize=10;
|
|
|
+ if (!$_GPC['seller_id']) {
|
|
|
+ echo '酒店id必填!';
|
|
|
+ }
|
|
|
+ $data[':uniacid']=$_W['uniacid'];
|
|
|
+ $data[':user_id']=$_GPC['user_id'];
|
|
|
+ $where=" where uniacid=:uniacid and user_id=:user_id ";
|
|
|
+ if($_GPC['status']){
|
|
|
+ $where.=" and status = :status and is_out_time = :is_out_time";
|
|
|
+ $data[':status'] = 10;
|
|
|
+ $data[':is_out_time'] = 1;
|
|
|
+ }
|
|
|
+ $sql="select * from " . tablename("zh_jdgjb_order") .$where." order by id desc ";
|
|
|
+ $select_sql=$sql." LIMIT " .($pageindex - 1) * $pagesize.",".$pagesize;
|
|
|
+ $list=pdo_fetchall($select_sql,$data);
|
|
|
+ foreach($list as $key=>$val){
|
|
|
+ $list[$key]['count']=pdo_fetchcolumn("SELECT count(*) FROM ".tablename('zh_jdgjb_order') .$where.' and id<='.$val['id'].' and user_id='.$val['user_id'] ,$data)?:0;
|
|
|
+ }
|
|
|
+ $list = pdo_get('zh_jdgjb_seller',array('id'=>$_GPC['seller_id']));
|
|
|
+ echo json_encode(['data' => $list, 're_pay_money' => $list['re_pay_money']]);
|
|
|
+ }
|
|
|
+
|
|
|
//订单详情
|
|
|
public function doPageOrderDetails(){
|
|
|
global $_GPC, $_W;
|