|
@@ -356,32 +356,32 @@ class Order extends Api |
|
@@ -356,32 +356,32 @@ class Order extends Api |
356
|
{
|
356
|
{
|
357
|
$UserId = $this->is_token($this->request->header());
|
357
|
$UserId = $this->is_token($this->request->header());
|
358
|
$params = $this->request->param();
|
358
|
$params = $this->request->param();
|
359
|
-// $data = [
|
|
|
360
|
-// 'user_id' => $UserId,
|
|
|
361
|
-// 'OrderSn' => $params['OrderSn'],
|
|
|
362
|
-// 'createtime' => time()
|
|
|
363
|
-// ];
|
|
|
364
|
-// $res = Db::name('tuikuan')->insert($data);
|
|
|
365
|
-// if (!$res) {
|
|
|
366
|
-// $this->error('申请失败', 0);
|
|
|
367
|
-// die;
|
|
|
368
|
-// }
|
|
|
369
|
-// //修改订单状态
|
|
|
370
|
-// $res2 = Db::name('order')->where('OrderSn', $params['OrderSn'])->update(
|
|
|
371
|
-// [
|
|
|
372
|
-// 'status' => 4,
|
|
|
373
|
-// 'updatetime' => time()
|
|
|
374
|
-// ]
|
|
|
375
|
-// );
|
359
|
+ $data = [
|
|
|
360
|
+ 'user_id' => $UserId,
|
|
|
361
|
+ 'OrderSn' => $params['OrderSn'],
|
|
|
362
|
+ 'createtime' => time()
|
|
|
363
|
+ ];
|
|
|
364
|
+ $res = Db::name('tuikuan')->insert($data);
|
|
|
365
|
+ if (!$res) {
|
|
|
366
|
+ $this->error('申请失败', 0);
|
|
|
367
|
+ die;
|
|
|
368
|
+ }
|
|
|
369
|
+ //修改订单状态
|
|
|
370
|
+ $res2 = Db::name('order')->where('OrderSn', $params['OrderSn'])->update(
|
|
|
371
|
+ [
|
|
|
372
|
+ 'status' => 4,
|
|
|
373
|
+ 'updatetime' => time()
|
|
|
374
|
+ ]
|
|
|
375
|
+ );
|
376
|
$GuanYiCloud = new GuanYiCloud();
|
376
|
$GuanYiCloud = new GuanYiCloud();
|
377
|
$Oid = $GuanYiCloud->GetOrderOid($params['OrderSn']);
|
377
|
$Oid = $GuanYiCloud->GetOrderOid($params['OrderSn']);
|
378
|
$GuanYiCloud->OrderUpdate($params['OrderSn'], $Oid);
|
378
|
$GuanYiCloud->OrderUpdate($params['OrderSn'], $Oid);
|
379
|
-// if (!$res2) {
|
|
|
380
|
-// $this->error('订单状态更改失败', 0);
|
|
|
381
|
-// die;
|
|
|
382
|
-// } else {
|
|
|
383
|
-// $this->success('成功', 1);
|
|
|
384
|
-// }
|
379
|
+ if (!$res2) {
|
|
|
380
|
+ $this->error('订单状态更改失败', 0);
|
|
|
381
|
+ die;
|
|
|
382
|
+ } else {
|
|
|
383
|
+ $this->success('成功', 1);
|
|
|
384
|
+ }
|
385
|
}
|
385
|
}
|
386
|
|
386
|
|
387
|
|
387
|
|