作者 郭文星

132

@@ -122,7 +122,14 @@ class Car extends Backend @@ -122,7 +122,14 @@ class Car extends Backend
122 "driver_id"=>$driver["id"], 122 "driver_id"=>$driver["id"],
123 "route_id"=>$route["id"], 123 "route_id"=>$route["id"],
124 ]; 124 ];
125 - $url_data="?start_address={$route["start_address"]}&route_id={$route["id"]}&driver_id={$driver["id"]}&license_plate={$car["license_plate"]}&name={$driver["name"]}&end_address{$route["end_address"]}&price{$route["price"]}"; 125 + $url_data=
  126 + "pages/module/intercityOrder?start_address=".$route['start_address']."
  127 + &route_id=".$route['id']."
  128 + &driver_id=".$driver['id']."
  129 + &license_plate=".$car['license_plate']."
  130 + &name=".$driver['name']."
  131 + &end_address=".$route['end_address']."
  132 + &price=".$route['price'];
126 $place_image=$this->getQRCode($url_data); 133 $place_image=$this->getQRCode($url_data);
127 $result = Db::name('driver')->where('id','=',$driver["id"])->update(['place_image'=>$place_image['fileurl']]); 134 $result = Db::name('driver')->where('id','=',$driver["id"])->update(['place_image'=>$place_image['fileurl']]);
128 Db::commit(); 135 Db::commit();
@@ -189,8 +196,14 @@ class Car extends Backend @@ -189,8 +196,14 @@ class Car extends Backend
189 "driver_id"=>$driver["id"], 196 "driver_id"=>$driver["id"],
190 "route_id"=>$route["id"], 197 "route_id"=>$route["id"],
191 ]; 198 ];
192 - $url_data="?start_address={$route["start_address"]}&route_id={$route["id"]}&driver_id={$driver["id"]}&license_plate={$car["license_plate"]}&name={$driver["name"]}&end_address{$route["end_address"]}&price{$route["price"]}";  
193 - $place_image=$this->getQRCode($url_data); 199 + $url_data=
  200 + "pages/module/intercityOrder?start_address=".$route['start_address']."
  201 + &route_id=".$route['id']."
  202 + &driver_id=".$driver['id']."
  203 + &license_plate=".$car['license_plate']."
  204 + &name=".$driver['name']."
  205 + &end_address=".$route['end_address']."
  206 + &price=".$route['price'];$place_image=$this->getQRCode($url_data);
194 $result = Db::name('driver')->where('id','=',$driver["id"])->update(['place_image'=>$place_image]); 207 $result = Db::name('driver')->where('id','=',$driver["id"])->update(['place_image'=>$place_image]);
195 } 208 }
196 209
@@ -261,12 +274,10 @@ class Car extends Backend @@ -261,12 +274,10 @@ class Car extends Backend
261 curl_close($curl); 274 curl_close($curl);
262 return $result; 275 return $result;
263 } 276 }
264 - public function getQRCode(){ 277 + public function getQRCode($url_data){
265 $accessToken = $this->getAccessToken(); 278 $accessToken = $this->getAccessToken();
266 if ($accessToken) { 279 if ($accessToken) {
267 - $path = 'pages/module/intercityOrder'; // 小程序内的页面路径  
268 - $qrCodeData = $this->createMiniProgramQRCode($accessToken, $path);  
269 - print_r($qrCodeData);return; 280 + $qrCodeData = $this->createMiniProgramQRCode($accessToken, $url_data);
270 return $qrCodeData; 281 return $qrCodeData;
271 } 282 }
272 } 283 }
@@ -299,7 +299,7 @@ class Car extends Base @@ -299,7 +299,7 @@ class Car extends Base
299 */ 299 */
300 public function switching_driver() 300 public function switching_driver()
301 { 301 {
302 - $res = Db::name("driver")->where("user_id", $this->auth->id)->find(); 302 + $res = Db::name("driver")->where("user_id", 37)->find();
303 $car = Db::name("car")->where("driver_id", $res['id'])->find(); 303 $car = Db::name("car")->where("driver_id", $res['id'])->find();
304 if ($car) { 304 if ($car) {
305 //本月收入 305 //本月收入