report union
parent
56cb94b5b3
commit
e1016aefea
|
|
@ -42,7 +42,7 @@ class ReportShopOrderController extends AdminController
|
||||||
|
|
||||||
$orders = Order::select([
|
$orders = Order::select([
|
||||||
'shop_id',
|
'shop_id',
|
||||||
DB::raw('SUM(IF(type = 3, union_money, money)) AS money')
|
DB::raw('SUM(IF(type = 3, IF(id=pid, money, 0), money)) AS money')
|
||||||
])
|
])
|
||||||
->where('pay_state', PayState::SUCCESS)
|
->where('pay_state', PayState::SUCCESS)
|
||||||
->whereIn('lottery_state', [LottState::WIN, LottState::LOSS, LottState::WAIT, LottState::SEND])
|
->whereIn('lottery_state', [LottState::WIN, LottState::LOSS, LottState::WAIT, LottState::SEND])
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ class GenerateDaySeller extends Command
|
||||||
public function report(Seller $seller, $cdate)
|
public function report(Seller $seller, $cdate)
|
||||||
{
|
{
|
||||||
$chupiaoMoneyRow = Order::select([
|
$chupiaoMoneyRow = Order::select([
|
||||||
DB::raw('sum(IF(type = 3, union_money, money)) as m')
|
DB::raw('sum(IF(type = 3, IF(id=pid, money, 0), money)) as m')
|
||||||
])
|
])
|
||||||
->usable()
|
->usable()
|
||||||
->where('draft_date', $cdate)
|
->where('draft_date', $cdate)
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ class GenerateDayShop extends Command
|
||||||
public function report(Shop $shop, $cdate)
|
public function report(Shop $shop, $cdate)
|
||||||
{
|
{
|
||||||
$chupiaoMoneyRow = Order::select([
|
$chupiaoMoneyRow = Order::select([
|
||||||
DB::raw('sum(IF(type = 3, union_money, money)) as m')
|
DB::raw('sum(IF(type = 3, IF(id=pid, money, 0), money)) as m')
|
||||||
])
|
])
|
||||||
->usable()
|
->usable()
|
||||||
->where('draft_date', $cdate)
|
->where('draft_date', $cdate)
|
||||||
|
|
|
||||||
|
|
@ -1234,7 +1234,7 @@ class CustomerController extends BaseController
|
||||||
|
|
||||||
$orders = Order::select([
|
$orders = Order::select([
|
||||||
'customer_id',
|
'customer_id',
|
||||||
DB::raw('SUM(IF(type = 3, union_money, money)) AS money')
|
DB::raw('SUM(IF(type = 3, IF(id=pid, money, 0), money)) AS money')
|
||||||
])->agentUsable()
|
])->agentUsable()
|
||||||
->whereIn('customer_id',$customerIdList)
|
->whereIn('customer_id',$customerIdList)
|
||||||
->where('pay_state', PayState::SUCCESS)
|
->where('pay_state', PayState::SUCCESS)
|
||||||
|
|
|
||||||
|
|
@ -253,7 +253,7 @@ class ReportController extends BaseController
|
||||||
}
|
}
|
||||||
|
|
||||||
$query = Order::select([
|
$query = Order::select([
|
||||||
DB::raw('sum(IF(type = 3, union_money, money)) as money'),
|
DB::raw('sum(IF(type = 3, IF(id=pid, money, 0), money)) as money'),
|
||||||
DB::raw('count(*) as count'),
|
DB::raw('count(*) as count'),
|
||||||
'lottery_type_id',
|
'lottery_type_id',
|
||||||
])
|
])
|
||||||
|
|
@ -747,7 +747,7 @@ class ReportController extends BaseController
|
||||||
'created_at',
|
'created_at',
|
||||||
'updated_at',
|
'updated_at',
|
||||||
'created_date',
|
'created_date',
|
||||||
DB::raw('IF(type = 3, union_money, money) AS money')
|
DB::raw('IF(type = 3, IF(id=pid, money, 0), money) AS money')
|
||||||
])
|
])
|
||||||
->agentUsable()
|
->agentUsable()
|
||||||
->where('shop_id', $this->shopId())
|
->where('shop_id', $this->shopId())
|
||||||
|
|
@ -758,7 +758,7 @@ class ReportController extends BaseController
|
||||||
->paging($size);
|
->paging($size);
|
||||||
|
|
||||||
$allMoneyData = Order::select(
|
$allMoneyData = Order::select(
|
||||||
DB::raw('SUM(IF(type = 3, union_money, money)) AS money')
|
DB::raw('SUM(IF(type = 3, IF(id=pid, money, 0), money)) AS money')
|
||||||
)
|
)
|
||||||
->agentUsable()
|
->agentUsable()
|
||||||
->where('shop_id', $this->shopId())
|
->where('shop_id', $this->shopId())
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue