作者 王智

文档修改

... ... @@ -290,6 +290,8 @@ class GuanYiCloud extends Api
// $date['receiver_mobile']='15928552965';
$data['sign'] = $this->sign($data, SECRET);
$Array = json_decode(json_encode(json_decode($this->mycurl(URL, $data))), true);
dump($Array);
die;
if ($Array['success'] == false) {
$this->error('订单推送失败');
}
... ...
... ... @@ -356,32 +356,32 @@ class Order extends Api
{
$UserId = $this->is_token($this->request->header());
$params = $this->request->param();
$data = [
'user_id' => $UserId,
'OrderSn' => $params['OrderSn'],
'createtime' => time()
];
$res = Db::name('tuikuan')->insert($data);
if (!$res) {
$this->error('申请失败', 0);
die;
}
//修改订单状态
$res2 = Db::name('order')->where('OrderSn', $params['OrderSn'])->update(
[
'status' => 4,
'updatetime' => time()
]
);
// $data = [
// 'user_id' => $UserId,
// 'OrderSn' => $params['OrderSn'],
// 'createtime' => time()
// ];
// $res = Db::name('tuikuan')->insert($data);
// if (!$res) {
// $this->error('申请失败', 0);
// die;
// }
// //修改订单状态
// $res2 = Db::name('order')->where('OrderSn', $params['OrderSn'])->update(
// [
// 'status' => 4,
// 'updatetime' => time()
// ]
// );
$GuanYiCloud = new GuanYiCloud();
$Oid = $GuanYiCloud->GetOrderOid($params['OrderSn']);
$GuanYiCloud->OrderUpdate($params['OrderSn'], $Oid);
if (!$res2) {
$this->error('订单状态更改失败', 0);
die;
} else {
$this->success('成功', 1);
}
// if (!$res2) {
// $this->error('订单状态更改失败', 0);
// die;
// } else {
// $this->success('成功', 1);
// }
}
... ...
... ... @@ -207,7 +207,7 @@ class Pay extends Api
);
//添加用户积分记录
$Fuser_idSql2 = [
'user_id' => $PayOrderInfo['user_id'],
'user_id' => $Fuser_id,
'status' => 1,
'type' => 9,
'num' => floor($OrderInfo['total']),
... ... @@ -354,12 +354,12 @@ class Pay extends Api
$RecordedFirstMoney = array_sum($FirstMoney);
$FirstUserInfoArray = Db::name('user')->where('id', $FatherUserId)->find();
//扣除积分 增加余额
Db::name('user')->where('id', $FatherUserId)->update(
[
// 'num' => $FirstUserInfoArray['num'] - $RecordedFirstMoney,
'money' => $FirstUserInfoArray['money'] + $RecordedFirstMoney
]
);
// Db::name('user')->where('id', $FatherUserId)->update(
// [
//// 'num' => $FirstUserInfoArray['num'] - $RecordedFirstMoney,
// 'money' => $FirstUserInfoArray['money'] + $RecordedFirstMoney
// ]
// );
//添加用户积分记录
// $FirstNumuSql = [
// 'user_id' => $FatherUserId,
... ... @@ -408,12 +408,12 @@ class Pay extends Api
$RecordedSecondMoney = array_sum($SecondMoney);
$SecondUserInfoArray = Db::name('user')->where('id', $GroundFatherUserId)->find();
//扣除积分 增加余额
Db::name('user')->where('id', $GroundFatherUserId)->update(
[
// 'num' => $SecondUserInfoArray['num'] - $RecordedSecondMoney,
'money' => $SecondUserInfoArray['money'] + $RecordedSecondMoney
]
);
// Db::name('user')->where('id', $GroundFatherUserId)->update(
// [
//// 'num' => $SecondUserInfoArray['num'] - $RecordedSecondMoney,
// 'money' => $SecondUserInfoArray['money'] + $RecordedSecondMoney
// ]
// );
// //添加用户积分记录
// $SecondNumuSql = [
// 'user_id' => $GroundFatherUserId,
... ...