12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?php
- namespace App\Console\Commands;
- use Illuminate\Console\Command;
- use Symfony\Component\Console\Input\InputOption;
- use Symfony\Component\Console\Input\InputArgument;
- use TopClient;
- use DB;
- use YPSMS;
- class SendOrder extends Command {
- protected $signature = 'SendOrder';
- /**
- * The console command description.
- *
- * @var string
- */
- protected $description = '提醒仓管新订单短信';
- public function handle()
- {
- $this->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);
- }
- }
- }
|