thinkphp5は、設定された営業時間に従って毎日の売上高をグループ化します

$day_start_time = '11:22:33';
$hour = substr ($day_start_time , 0, 2);
$minute = substr ($day_start_time , -5, 2);
$second   = substr ($day_start_time , -2);
​​​​​​​$orders = DB::name('wxOrder')
            ->field("createTime,SUM(DISTINCT dayAmount) orderpaid,FROM_UNIXTIME(createTime,'%Y-%m-%d $hour:$minute:$second') AS dayorder")
            ->where('contactNumber',$contact_number)
            ->where('isDelete',0)
            ->where('orderStatus', 4)
            ->where('payStatus', 1)
            ->group('dayorder')
            ->select();

 

公開された23元の記事 ウォンの賞賛2 ビュー5249

おすすめ

転載: blog.csdn.net/bianlitongcn/article/details/98874195