1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| <?php
global $_W; global $_GPC; $id = intval($_GPC['id']); $paramTotal = array('uniacid' => $_W['uniacid']);
if (!empty($id)) { //查询出当前id的申请退款表中的信息 $data = pdo_fetch('select * from ' . tablename(weikang_deposit_refund) . 'where id =' . $id . ' and uniacid =:uniacid ', $paramTotal); $refundData = pdo_fetchall('select b.status from ' . tablename('weikang_deposit_refund') . 'a left join ' . tablename('ewei_shop_order') . 'b on a.openid = b.openid where a.uniacid=:uniacid and b.order_type =1 and b.status in (0,1,2)', $paramTotal); if(count($refundData) > 0){ show_json(0,array("id"=>$id,"message"=>"存在未支付订单")); } //正在使用的订单是空的,更新申请退款表和押金表中的数据 $refundData = array('deal_time' => date("Y-m-d H:i:s"), 'draw_status' => 1, 'operate_user' => $_W['account']['name']); $depositData = array('refund_time' => date("Y-m-d H:i:s"), 'refund_id' => $id); //更新数据 pdo_update('ims_weikang_deposit', $depositData, array('uniacid' => $_W['uniacid'], 'id' => $data['deposit_id']));
pdo_update('ims_weikang_deposit_refund', $refundData, array('uniacid' => $_W['uniacid'], 'id' => $id)); show_json(1,array("id"=>$id,"message"=>"申请成功")); }
show_json 格式:{"status":1,"result":{"id":1,"message":"\u7533\u8bf7\u6210\u529f","url":"http:\/\/localhost:8080\/"}}
下面会下如何取得json中的数据
|