|
@@ -2,6 +2,7 @@
|
|
|
|
|
|
namespace app\common\model;
|
|
|
|
|
|
+use app\admin\controller\City;
|
|
|
use app\admin\model\Address;
|
|
|
use app\admin\model\AdminMoneyLog;
|
|
|
use app\common\service\GyeUdun;
|
|
@@ -257,8 +258,8 @@ class Orders extends Model
|
|
|
}
|
|
|
public function makeSendSelf(Address $address,$remark){
|
|
|
$com=LogisticsCompany::getSelf();
|
|
|
-
|
|
|
-
|
|
|
+ $orderAddress = OrderAddress::where(['order_id'=>$this->id])->find()->toArray();
|
|
|
+ // dump($orderAddress);
|
|
|
$newData=[
|
|
|
'com_id'=>$com->id,
|
|
|
'remark'=>$remark,
|
|
@@ -269,6 +270,15 @@ class Orders extends Model
|
|
|
//'md_link'=>$label,
|
|
|
//'trans_no'=>$data['kuaidinum'],
|
|
|
];
|
|
|
+ $newData = array_filter($newData);
|
|
|
+ $cityId = explode(',',$orderAddress['area']);
|
|
|
+ $toCity = Area::where(['id'=>$cityId[1]])->value('name');
|
|
|
+ $fromCitys = Address::where(['id'=>$address->id])->value('area');
|
|
|
+ $fromCity = explode("/",$fromCitys);
|
|
|
+ $expType = '';
|
|
|
+ if($toCity == $fromCity[1]){
|
|
|
+ $expType = '同城次日';
|
|
|
+ }
|
|
|
$logistics=$this->logistics()->save($newData);
|
|
|
|
|
|
$names=[];
|
|
@@ -287,7 +297,9 @@ class Orders extends Model
|
|
|
->setCargo(implode('&',$names))
|
|
|
->setCount($this->info()->sum('num'))
|
|
|
->setOrderNo($this->order_no)
|
|
|
+ ->setExpType($expType)
|
|
|
->labelOrder();
|
|
|
+
|
|
|
if(!$res){
|
|
|
throw_user($data);
|
|
|
}
|
|
@@ -298,6 +310,7 @@ class Orders extends Model
|
|
|
if(!is_dir($dir)){
|
|
|
@mkdir($dir,0755,true);
|
|
|
}
|
|
|
+ dump($saveName); dump($data['label']);
|
|
|
file_put_contents($saveName,file_get_contents($data['label']));
|
|
|
$label=request()->domain().$pubname.'/'.$filename;
|
|
|
|