作者 郭文星

123

@@ -122,14 +122,14 @@ class Car extends Backend @@ -122,14 +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="pages/module/intercityOrder?start_address=".$route['start_address']." 125 + $urldata="start_address=".$route['start_address']."
126 &route_id=".$route['id']." 126 &route_id=".$route['id']."
127 &driver_id=".$driver['id']." 127 &driver_id=".$driver['id']."
128 &license_plate=".$car['license_plate']." 128 &license_plate=".$car['license_plate']."
129 &name=".$driver['name']." 129 &name=".$driver['name']."
130 &end_address=".$route['end_address']." 130 &end_address=".$route['end_address']."
131 &price=".$route['price']; 131 &price=".$route['price'];
132 - $url_data=urlencode($url_data); 132 + $url_data=urlencode($urldata);
133 $place_image=$this->getQRCode($url_data); 133 $place_image=$this->getQRCode($url_data);
134 //encodeURIComponent 134 //encodeURIComponent
135 $result = Db::name('driver')->where('id','=',$driver["id"])->update(['place_image'=>$place_image['fileurl']]); 135 $result = Db::name('driver')->where('id','=',$driver["id"])->update(['place_image'=>$place_image['fileurl']]);
@@ -197,14 +197,14 @@ class Car extends Backend @@ -197,14 +197,14 @@ class Car extends Backend
197 "driver_id"=>$driver["id"], 197 "driver_id"=>$driver["id"],
198 "route_id"=>$route["id"], 198 "route_id"=>$route["id"],
199 ]; 199 ];
200 - $url_data="pages/module/intercityOrder?start_address=".$route['start_address']." 200 + $urldata="start_address=".$route['start_address']."
201 &route_id=".$route['id']." 201 &route_id=".$route['id']."
202 &driver_id=".$driver['id']." 202 &driver_id=".$driver['id']."
203 &license_plate=".$car['license_plate']." 203 &license_plate=".$car['license_plate']."
204 &name=".$driver['name']." 204 &name=".$driver['name']."
205 &end_address=".$route['end_address']." 205 &end_address=".$route['end_address']."
206 &price=".$route['price']; 206 &price=".$route['price'];
207 - $url_data=urlencode($url_data); 207 + $url_data=urlencode($urldata);
208 $place_image=$this->getQRCode($url_data); 208 $place_image=$this->getQRCode($url_data);
209 $result = Db::name('driver')->where('id','=',$driver["id"])->update(['place_image'=>$place_image['fileurl']]); 209 $result = Db::name('driver')->where('id','=',$driver["id"])->update(['place_image'=>$place_image['fileurl']]);
210 } 210 }
@@ -230,6 +230,7 @@ class Car extends Backend @@ -230,6 +230,7 @@ class Car extends Backend
230 } 230 }
231 231
232 function createMiniProgramQRCode($accessToken, $path, $width = 430) { 232 function createMiniProgramQRCode($accessToken, $path, $width = 430) {
  233 + $path = 'pages/module/intercityOrder?url='.$path; // 小程序内的页面路径
233 $url = "https://api.weixin.qq.com/wxa/getwxacode?access_token={$accessToken}"; 234 $url = "https://api.weixin.qq.com/wxa/getwxacode?access_token={$accessToken}";
234 $data = json_encode([ 235 $data = json_encode([
235 'path' => $path, 236 'path' => $path,