diff --git a/app/Model/v3/Goods.php b/app/Model/v3/Goods.php index bf0417f..ff1eaba 100644 --- a/app/Model/v3/Goods.php +++ b/app/Model/v3/Goods.php @@ -39,7 +39,7 @@ class Goods extends Model * * @var string */ - protected $table = 'lanzu_goods_new'; + protected $table = 'lanzu_goods'; /** * The attributes that are mass assignable. * diff --git a/app/Model/v3/GoodsBanner.php b/app/Model/v3/GoodsBanner.php index da008a7..8ca3a22 100644 --- a/app/Model/v3/GoodsBanner.php +++ b/app/Model/v3/GoodsBanner.php @@ -18,7 +18,7 @@ class GoodsBanner extends Model protected $attachmentService; use SoftDeletes; - protected $table = 'lanzu_goods_banners_new'; + protected $table = 'lanzu_goods_banners'; protected $appends = [ 'banner_url', diff --git a/app/Model/v3/Store.php b/app/Model/v3/Store.php index 830c019..25f4c05 100644 --- a/app/Model/v3/Store.php +++ b/app/Model/v3/Store.php @@ -25,7 +25,7 @@ class Store extends Model * * @var string */ - protected $table = 'lanzu_store_new'; + protected $table = 'lanzu_store'; /** * The attributes that are mass assignable. * diff --git a/app/Service/v3/Implementations/FeiePrintService.php b/app/Service/v3/Implementations/FeiePrintService.php index 3041c41..20b8eeb 100644 --- a/app/Service/v3/Implementations/FeiePrintService.php +++ b/app/Service/v3/Implementations/FeiePrintService.php @@ -46,18 +46,6 @@ class FeiePrintService implements FeiePrintServiceInterface $query->with('store','orderGoods'); } ])->where('global_order_id',$globalOrderId)->first(); - // $data = Db::table('lanzu_order_main as m') - // ->join('lanzu_order as o','o.order_main_id', '=', 'm.global_order_id','inner') - // ->join('lanzu_order_goods as g','o.id','=', 'g.order_id','inner') - // ->join('lanzu_feprint as f','m.market_id','=', 'f.market_id','inner') - // ->join('lanzu_store_new as s','s.id','=', 'o.store_id','inner') - // ->where('m.global_order_id', $globalOrderId) - // ->selectRaw("o.note as o_note,g.name,g.number,g.price,g.goods_unit,m.delivery_time_note as ps_time,m.address,m.note,m.name as user_name,m.delivery_money,m.money as m_money,m.coupon_money,m.services_money,f.sn,m.tel,m.order_num,g.id,g.spec,s.name as shopname") - // ->orderBy('s.id') - // ->get() - // ->toArray(); - // print_r($data); - // return $data; if (empty($data)) { return ; } @@ -183,139 +171,6 @@ class FeiePrintService implements FeiePrintServiceInterface $tel = substr_replace( $arr->tel, '****', 3, 4); $orderInfo .= '联系电话:' . $tel . '
'; $orderInfo .= '送达时间:' . $arr->delivery_time_note . '
'; - - - - // $name = $v5['name']; - // $name .= "(规格:". $v5['goods_unit'].")"; - // $price = $v5['m_money']; - // $num = $v5['number']; - // $prices = sprintf("%.2f",$v5['m_money']*$v5['number']); - // $kw3 = ''; - // $kw1 = ''; - // $kw2 = ''; - // $kw4 = ''; - // $str = $name; - // $blankNum = $A;//名称控制为14个字节 - // $lan = mb_strlen($str,'utf-8'); - // $m = 0; - // $j=1; - // $blankNum++; - // $result = array(); - // if(strlen($price) < $B){ - // $k1 = $B - strlen($price); - // for($q=0;$q<$k1;$q++){ - // $kw1 .= ' '; - // } - // $price = $kw1.$price; - // } - // if(strlen($num) < $C){ - // $k2 = $C - strlen($num); - // for($q=0;$q<$k2;$q++){ - // $kw2 .= ' '; - // } - // $num = $kw2.$num; - // } - // if(strlen($prices) < $D){ - // $k3 = $D - strlen($prices); - // for($q=0;$q<$k3;$q++){ - // $kw4 .= ' '; - // } - // $prices = $kw4.$prices; - // } - // for ($i=0;$i<$lan;$i++){ - // $new = mb_substr($str,$m,$j,'utf-8'); - // $j++; - // if(mb_strwidth($new,'utf-8')<$blankNum) { - // if($m+$j>$lan) { - // $m = $m+$j; - // $tail = $new; - // // $lenght = iconv("UTF-8", "GBK//IGNORE", $new); - // $k = $A - mb_strwidth($new,'utf-8'); - // for($q=0;$q<$k;$q++){ - // $kw3 .= ' '; - // } - // if($m==$j){ - // $tail .= $kw3.' '.$price.' '.$num.' '.$prices; - // }else{ - // $tail .= $kw3.'
'; - // } - // break; - // }else{ - // $next_new = mb_substr($str,$m,$j,'utf-8'); - // if(mb_strwidth($next_new,'utf-8')<$blankNum) continue; - // else{ - // $m = $i+1; - // $result[] = $new; - // $j=1; - // } - // } - // } - // } - // $head = ''; - // foreach ($result as $key=>$value) { - // if($key < 1){ - // // $v_lenght = iconv("UTF-8", "GBK//IGNORE", $value); - // $v_lenght = mb_strwidth($value,'utf-8'); - // if($v_lenght == 13) $value = $value." "; - // $head .= $value.' '.$price.' '.$num.' '.$prices; - // }else{ - // $head .= $value.'
'; - // } - // } - // $orderInfo .= $head.$tail; - // if(!empty($v5['o_note'])){ - // $orderInfo .= '备注:'.$v5['o_note'].'
'; - // } - // } - // // $time = date('Y-m-d H:i:s', time()); - // $orderInfo .= '--------------------------------
'; - // if ($arr[0]['services_money'] > 0) { - // $kw5 = ''; - // $len = 24 - strlen($arr[0]['services_money']); - // for ($q = 0; $q < $len; $q++) { - // $kw5 .= ' '; - // } - // $orderInfo .= '服务费:' . $kw5 . $arr[0]['services_money'] . '
'; - // } - // if($arr[0]['delivery_money'] > 0){ - // $kw5 = ''; - // $len = 24 - strlen($arr[0]['delivery_money']); - // for ($q = 0; $q < $len; $q++) { - // $kw5 .= ' '; - // } - // $orderInfo .= '配送费:'.$kw5.$arr[0]['delivery_money'].'
'; - // } - // if($arr[0]['coupon_money'] > 0){ - // $coupon_money = sprintf("%.2f",$arr[0]['coupon_money']); - // $kw6 = ''; - // $len = 25 - strlen($coupon_money); - // for ($q = 0; $q < $len; $q++) { - // $kw6 .= ' '; - // } - // $orderInfo .= '红包:'.$kw6.'-'.$coupon_money.'
'; - // } - // $total = '合计:'.$arr[0]['m_money']; - // $user_name = $arr[0]['user_name']; - // if(strlen($user_name)>18){ - // $user_name=substr($user_name,0,18).'...'; - // } - // $str = $user_name . $total; - // $kw5 = ''; - // // $lenght = iconv("UTF-8", "GBK//IGNORE", $str); - // $total_len = 32 - mb_strwidth($str,'utf-8'); - // for ($q = 0; $q < $total_len; $q++) { - // $kw5 .= ' '; - // } - // $total_str = $user_name.$kw5.$total; - // $orderInfo .= $total_str.'
'; - // $orderInfo .= '送货地点:' . $arr[0]['address'] . '
'; - // $tel = substr_replace( $arr[0]['tel'], '****', 3, 4); - // $orderInfo .= '联系电话:' . $tel . '
'; - // $orderInfo .= '配送时间:' . $arr[0]['ps_time'] . '
'; - // if(!empty($arr[0]['note'])){ - // $orderInfo .= '备注:'.$arr[0]['note'].'

'; - // } //$orderInfo .= 'http://www.feieyun.com';//把解析后的二维码生成的字符串用标签套上即可自动生成二维码 return $orderInfo; } diff --git a/app/Service/v3/Implementations/LocationService.php b/app/Service/v3/Implementations/LocationService.php index 2e7eb18..8308c59 100644 --- a/app/Service/v3/Implementations/LocationService.php +++ b/app/Service/v3/Implementations/LocationService.php @@ -158,10 +158,13 @@ class LocationService implements LocationServiceInterface $response = $client->request('GET', $url.$type.'/?from='.$lat1.','.$lng1.'&to='.$lat2.','.$lng2.'&output=json&key='.$key); $response = $response->getBody()->getContents(); $resultArr = json_decode($response,true); + if($resultArr['status'] == 384) + { + return 100; + } if($resultArr['status'] > 0) { - return 1000; - //throw new ErrorCodeException(ErrorCode::LOCATION_ERROR,$resultArr['message']); + throw new ErrorCodeException(ErrorCode::LOCATION_ERROR,$resultArr['message']); } $distance = $resultArr['result']['routes'][0]['distance']; return $distance;