SendOrder(); } public function SendOrder(){ #今日 $today = date('Y-m-d'); $_start = '2019-09-18'; //A仓 $orders = DB::table('order')->where('status', 2)->where('delivery_date', '<=', $today)->where('createTime', '>=', $_start)->where('warehouse', 1)->where(function($query) use($today){ $query->where('logistics_id','=','')->orWhere('logistics_id','is',null); })->lists('id'); if(!empty($orders)){ $orders = json_decode(json_encode($orders), true); $order_ids = implode(',',$orders); $res = YPSMS::sendMsg('15695966629', 2, $order_ids, $today.'前'); $res = YPSMS::sendMsg('13511074691', 2, $order_ids, $today.'前'); //$res = YPSMS::sendMsg('18501257479', 2, $order_ids, $today.'前'); var_dump($res); } //B仓 $orders = DB::table('order')->where('status', 2)->where('delivery_date', '<=', $today)->where('createTime', '>=', $_start)->where('warehouse', 2)->where(function($query) use($today){ $query->where('logistics_id','=','')->orWhere('logistics_id','is',null); })->lists('id'); if(!empty($orders)){ $orders = json_decode(json_encode($orders), true); $order_ids = implode(',',$orders); $res = YPSMS::sendMsg('13055396000', 2, $order_ids, $today.'前'); $res = YPSMS::sendMsg('13511074691', 2, $order_ids, $today.'前'); //$res = YPSMS::sendMsg('18501257479', 2, $order_ids, $today.'前'); var_dump($res); } } }