Commit e5cb40aa by 朱继来

添加计数

parent c4abb3bb
......@@ -1716,4 +1716,72 @@ Class OrderController extends Controller
return ['errcode'=>0, 'errmsg'=>'延长成功'];
}
public function tempCount(Request $request)
{
$current = strtotime(date('Y-m-d', time())); // 当天0点
$half = strtotime('2017-11-28'); // 半年
$year = strtotime('2017-05-28'); // 一年
// 订单数量
$halfCount = DB::connection('order')->table('lie_order')
// ->where('order_goods_type', 1)
// ->where('order_type', 1)
->whereNotIn('user_id', $this->testMobile())
->where('is_type', 0)
->whereBetween('create_time', [$half, $current])
->count();
echo '半年订单数:'.$halfCount.'<br>';
$yearCount = DB::connection('order')->table('lie_order')
->whereNotIn('user_id', $this->testMobile())
->where('is_type', 0)
->whereBetween('create_time', [$year, $current])
->count();
echo '一年订单数:'.$yearCount.'<br>';
// 普票订单数
$halfInvoice = DB::connection('order')
->table('lie_order as o')
->leftJoin('lie_order_invoice as i', 'o.order_id', '=', 'i.order_id')
->whereNotIn('o.user_id', $this->testMobile())
->where('o.is_type', 0)
->where('i.inv_type', 2)
->whereBetween('o.create_time', [$half, $current])
->count();
echo '半年普票订单数:'.$halfInvoice.'<br>';
$yearInvoice = DB::connection('order')
->table('lie_order as o')
->leftJoin('lie_order_invoice as i', 'o.order_id', '=', 'i.order_id')
->whereNotIn('o.user_id', $this->testMobile())
->where('o.is_type', 0)
->where('i.inv_type', 2)
->whereBetween('o.create_time', [$year, $current])
->count();
echo '一年普票订单数:'.$yearInvoice.'<br>';
// 增票订单数
$halfAddInvoice = DB::connection('order')
->table('lie_order as o')
->leftJoin('lie_order_invoice as i', 'o.order_id', '=', 'i.order_id')
->whereNotIn('o.user_id', $this->testMobile())
->where('o.is_type', 0)
->where('i.inv_type', 3)
->whereBetween('o.create_time', [$half, $current])
->count();
echo '半年增票订单数:'.$halfAddInvoice.'<br>';
$yearAddInvoice = DB::connection('order')
->table('lie_order as o')
->leftJoin('lie_order_invoice as i', 'o.order_id', '=', 'i.order_id')
->whereNotIn('o.user_id', $this->testMobile())
->where('o.is_type', 0)
->where('i.inv_type', 3)
->whereBetween('o.create_time', [$year, $current])
->count();
echo '一年增票订单数:'.$yearAddInvoice.'<br>';
}
}
\ No newline at end of file
......@@ -71,6 +71,7 @@ Route::group(['middleware' => 'web'], function () {
Route::match('post', '/ajaxRejected', 'OrderController@ajaxRejected');
Route::match(['get', 'post'], '/express_set', 'OrderController@expressSet');
Route::match(['get', 'post'], '/tempcount', 'OrderController@tempCount');
Route::post('/ajaxDownloadContract', 'OrderController@ajaxDownloadContract');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment