|
@@ -11,6 +11,7 @@ use app\admin\model\shopro\activity\GrouponLog as ActivityGrouponLog;
|
|
|
use app\admin\model\shopro\dispatch\Dispatch as DispatchModel;
|
|
|
use app\admin\model\shopro\dispatch\DispatchAutosend;
|
|
|
use addons\shopro\library\express\Express as ExpressLib;
|
|
|
+use think\Db;
|
|
|
|
|
|
|
|
|
|
|
@@ -82,16 +83,25 @@ class OrderDispatch
|
|
|
$orderItem->ext = array_merge($orderItem->ext, ['send_time' => time()]); // item 发货时间
|
|
|
$orderItem->save();
|
|
|
OrderAction::add($this->order, $orderItem, $admin, 'admin', "商品{$orderItem->goods_title}已发货");
|
|
|
+ }
|
|
|
|
|
|
+ //找不到未发货的了,也就是全都发货了
|
|
|
+ $check_nosend = Db::name('shopro_order_item')->where([
|
|
|
+ 'order_id' => $this->order->id,
|
|
|
+ 'dispatch_status' => OrderItem::DISPATCH_STATUS_NOSEND,
|
|
|
+ 'order_express_id' => 0,
|
|
|
+ ])->find();
|
|
|
+ if(empty($check_nosend)){
|
|
|
//发货,冗余到bill表
|
|
|
Db::name('bill')->where([
|
|
|
'table_name' => 'shopro_order',
|
|
|
'table_id' => $this->order->id,
|
|
|
])->update([
|
|
|
'status' => 2, //待收货
|
|
|
- ])
|
|
|
-
|
|
|
+ ]);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
$this->subscribeExpressInfo($orderExpress);
|
|
|
// 订单发货后
|
|
|
$data = [
|