|
@@ -26,24 +26,31 @@ class SendOrder extends Command {
|
26
|
26
|
public function SendOrder(){
|
27
|
27
|
#今日
|
28
|
28
|
$today = date('Y-m-d');
|
|
29
|
+ $_start = '2019-09-18';
|
29
|
30
|
//A仓
|
30
|
|
- $orders = DB::table('order')->where('delivery_date', $today)->where('warehouse', 1)->where(function($query) use($today){
|
|
31
|
+ $orders = DB::table('order')->where('delivery_date', '<=', $today)->where('delivery_date', '>=', $_start)->where('warehouse', 1)->where(function($query) use($today){
|
31
|
32
|
$query->where('logistics_id','=','')->orWhere('logistics_id','is',null);
|
32
|
33
|
})->lists('id');
|
33
|
34
|
if(!empty($orders)){
|
34
|
35
|
$orders = json_decode(json_encode($orders), true);
|
35
|
36
|
$order_ids = implode(',',$orders);
|
36
|
|
- $res = YPSMS::sendMsg('15695966629', 2, $order_ids, $today);
|
|
37
|
+ $res = YPSMS::sendMsg('15695966629', 2, $order_ids, $today.'前');
|
|
38
|
+ $res = YPSMS::sendMsg('13511074691', 2, $order_ids, $today.'前');
|
|
39
|
+ $res = YPSMS::sendMsg('18501257479', 2, $order_ids, $today.'前');
|
|
40
|
+var_dump($res);
|
37
|
41
|
}
|
38
|
|
-
|
39
|
42
|
//B仓
|
40
|
|
- $orders = DB::table('order')->where('delivery_date', $today)->where('warehouse', 2)->where(function($query) use($today){
|
|
43
|
+ $orders = DB::table('order')->where('delivery_date', '<=', $today)->where('delivery_date', '>=', $_start)->where('warehouse', 2)->where(function($query) use($today){
|
41
|
44
|
$query->where('logistics_id','=','')->orWhere('logistics_id','is',null);
|
42
|
45
|
})->lists('id');
|
43
|
46
|
if(!empty($orders)){
|
44
|
47
|
$orders = json_decode(json_encode($orders), true);
|
45
|
48
|
$order_ids = implode(',',$orders);
|
46
|
|
- $res = YPSMS::sendMsg('13055396000', 2, $order_ids, $today);
|
|
49
|
+ $res = YPSMS::sendMsg('13055396000', 2, $order_ids, $today.'前');
|
|
50
|
+ $res = YPSMS::sendMsg('13511074691', 2, $order_ids, $today.'前');
|
|
51
|
+ $res = YPSMS::sendMsg('18501257479', 2, $order_ids, $today.'前');
|
|
52
|
+var_dump($res);
|
|
53
|
+
|
47
|
54
|
}
|
48
|
55
|
}
|
49
|
56
|
|