|
|
|
@ -0,0 +1,66 @@ |
|
|
|
<?php |
|
|
|
|
|
|
|
namespace App\Console\Commands; |
|
|
|
|
|
|
|
use Illuminate\Console\Command; |
|
|
|
use DB; |
|
|
|
|
|
|
|
class OnlineOrderStatis extends Command |
|
|
|
{ |
|
|
|
/** |
|
|
|
* The name and signature of the console command. |
|
|
|
* |
|
|
|
* @var string |
|
|
|
*/ |
|
|
|
protected $signature = 'command:OnlineOrderStatis'; |
|
|
|
|
|
|
|
/** |
|
|
|
* The console command description. |
|
|
|
* |
|
|
|
* @var string |
|
|
|
*/ |
|
|
|
protected $description = 'Command 在线订单情况统计'; |
|
|
|
|
|
|
|
/** |
|
|
|
* Create a new command instance. |
|
|
|
* |
|
|
|
* @return void |
|
|
|
*/ |
|
|
|
public function __construct() |
|
|
|
{ |
|
|
|
parent::__construct(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Execute the console command. |
|
|
|
* |
|
|
|
* @return int |
|
|
|
*/ |
|
|
|
public function handle() |
|
|
|
{ |
|
|
|
|
|
|
|
$ret = DB::select("select main.id as '系统订单号',
|
|
|
|
main.order_num '订单号', |
|
|
|
main.global_order_id '全局订单ID', |
|
|
|
main.money '实付金额', |
|
|
|
main.total_money '订单原金额', |
|
|
|
main.yhq_money2 '优惠金额', |
|
|
|
market.name '市场名', |
|
|
|
main.user_id '下单用户ID', |
|
|
|
user.name '系统用户名', |
|
|
|
main.name '下单用户名', |
|
|
|
main.address '下单用户地址', |
|
|
|
FROM_UNIXTIME(main.time_add,'%Y-%m-%d %H:%i:%s') '下单时间' |
|
|
|
FROM ims_cjdc_order_main `main` |
|
|
|
INNER JOIN ims_cjdc_user `user` ON user.id=main.user_id |
|
|
|
INNER JOIN `ims_cjdc_market` `market` ON main.`market_id`=market.id |
|
|
|
where `time_add` >= 1599148800 and `time_add` <=1599235199 and `type` = 1 and state IN (4,5,10)");
|
|
|
|
|
|
|
|
$totalCount = count($ret); |
|
|
|
foreach ($ret as $key => $item) { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |