正在显示
1 个修改的文件
包含
7 行增加
和
17 行删除
@@ -158,26 +158,16 @@ class AdminOrderController extends AdminBaseController | @@ -158,26 +158,16 @@ class AdminOrderController extends AdminBaseController | ||
158 | curl_setopt($ch, CURLOPT_POST, 1);//post提交方式 | 158 | curl_setopt($ch, CURLOPT_POST, 1);//post提交方式 |
159 | curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($send)); | 159 | curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($send)); |
160 | $res = curl_exec($ch);//运行curl | 160 | $res = curl_exec($ch);//运行curl |
161 | -// $obj = new $res; | ||
162 | - echo "<pre/>"; | ||
163 | - print_r($res); | ||
164 | - die; | ||
165 | - if($obj->errcode == 0){ | ||
166 | - echo "<pre/>"; | ||
167 | - print_r('1'); | ||
168 | - die; | 161 | + $dec = json_decode($res) ; |
162 | + $final = $dec->errcode; | ||
163 | + if($final == 0){ | ||
164 | + Db::commit(); | ||
165 | + $this->apiResponse('1','操作成功'); | ||
169 | }else{ | 166 | }else{ |
170 | - echo "<pre/>"; | ||
171 | - print_r('2'); | ||
172 | - die; | 167 | + Db::rollback(); |
168 | + $this->apiResponse('0',$dec->errmsg); | ||
173 | } | 169 | } |
174 | 170 | ||
175 | - // $a = file_get_contents($res); | ||
176 | - echo "<pre/>"; | ||
177 | - print_r($res); | ||
178 | - die; | ||
179 | - Db::commit(); | ||
180 | - $this->apiResponse('1','操作成功'); | ||
181 | }else{ | 171 | }else{ |
182 | Db::rollback(); | 172 | Db::rollback(); |
183 | $this->apiResponse('0','操作失败'); | 173 | $this->apiResponse('0','操作失败'); |
-
请 注册 或 登录 后发表评论