...
|
...
|
@@ -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);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
...
|
...
|
|