作者 王智

文档修改

@@ -280,7 +280,6 @@ class GuanYiCloud extends Api @@ -280,7 +280,6 @@ class GuanYiCloud extends Api
280 //获取订单oid 280 //获取订单oid
281 public function OrderUpdate($OrderSn,$Oid) 281 public function OrderUpdate($OrderSn,$Oid)
282 { 282 {
283 - dump($Oid);  
284 $data = array(); 283 $data = array();
285 $data['appkey'] = APPKEY; 284 $data['appkey'] = APPKEY;
286 $data['sessionkey'] = SESSIONKEY; 285 $data['sessionkey'] = SESSIONKEY;
@@ -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
@@ -131,6 +131,10 @@ class User extends Api @@ -131,6 +131,10 @@ class User extends Api
131 $this->success('成功', $return); 131 $this->success('成功', $return);
132 } 132 }
133 133
  134 + public function ceshi()
  135 + {
  136 + dump(date('Y-m-d', 1615882950));
  137 + }
134 138
135 /** 139 /**
136 * 用户接口 140 * 用户接口