修改订单数量统计
This commit is contained in:
parent
00b31013a1
commit
1dd46946f5
@ -495,7 +495,7 @@ class StoreOrderDao extends BaseDao
|
|||||||
return ($this->getModel()::getDB())->whereIn('reconciliation_id', $reconciliation_id)->update(['reconciliation_id' => 0]);
|
return ($this->getModel()::getDB())->whereIn('reconciliation_id', $reconciliation_id)->update(['reconciliation_id' => 0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function dayOrderNum($day, $merId = null, $saleType = 1)
|
public function dayOrderNum($day, $merId = null, $saleType = 0)
|
||||||
{
|
{
|
||||||
return StoreOrder::getDB()->where('paid', 1)->when($merId, function ($query, $merId) {
|
return StoreOrder::getDB()->where('paid', 1)->when($merId, function ($query, $merId) {
|
||||||
$query->where('mer_id', $merId);
|
$query->where('mer_id', $merId);
|
||||||
|
@ -35,19 +35,15 @@ class StoreOrder extends BaseController
|
|||||||
|
|
||||||
public function orderStatistics($merId, StoreOrderRepository $repository)
|
public function orderStatistics($merId, StoreOrderRepository $repository)
|
||||||
{
|
{
|
||||||
$repository->saleType = $this->request->param('sale_type', 1);
|
|
||||||
$order = $repository->OrderTitleNumber($merId, null);
|
$order = $repository->OrderTitleNumber($merId, null);
|
||||||
$where = ['is_system_del' => 0, 'mer_id' => $merId];
|
$where = ['is_system_del' => 0, 'mer_id' => $merId];
|
||||||
if ($repository->saleType > 0) {
|
|
||||||
$where['sale_type'] = $repository->saleType;
|
|
||||||
}
|
|
||||||
$order['refund'] = app()->make(StoreRefundOrderRepository::class)->getWhereCount($where);
|
$order['refund'] = app()->make(StoreRefundOrderRepository::class)->getWhereCount($where);
|
||||||
/** @var Common $common */
|
/** @var Common $common */
|
||||||
$common = app()->make(Common::class);
|
$common = app()->make(Common::class);
|
||||||
$data = [];
|
$data = [];
|
||||||
$data['today'] = $common->mainGroup('today', $merId, $repository->saleType);
|
$data['today'] = $common->mainGroup('today', $merId);
|
||||||
$data['yesterday'] = $common->mainGroup('yesterday', $merId, $repository->saleType);
|
$data['yesterday'] = $common->mainGroup('yesterday', $merId);
|
||||||
$data['month'] = $common->mainGroup('month', $merId, $repository->saleType);
|
$data['month'] = $common->mainGroup('month', $merId);
|
||||||
return app('json')->success(compact('order', 'data'));
|
return app('json')->success(compact('order', 'data'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ class StoreOrder extends BaseController
|
|||||||
return app('json')->status('public', '下单成功', ['order_id' => $groupOrder->group_order_id]);
|
return app('json')->status('public', '下单成功', ['order_id' => $groupOrder->group_order_id]);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
$this->repository = $this->request->post('withdrawal_pwd');
|
$this->repository->transPwd = $this->request->post('withdrawal_pwd');
|
||||||
return $this->repository->pay($payType, $this->request->userInfo(), $groupOrder, $this->request->param('return_url'), $this->request->isApp());
|
return $this->repository->pay($payType, $this->request->userInfo(), $groupOrder, $this->request->param('return_url'), $this->request->isApp());
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return app('json')->status('error', $e->getMessage(), ['order_id' => $groupOrder->group_order_id]);
|
return app('json')->status('error', $e->getMessage(), ['order_id' => $groupOrder->group_order_id]);
|
||||||
|
@ -87,7 +87,7 @@ class Common extends BaseController
|
|||||||
* @author xaboy
|
* @author xaboy
|
||||||
* @day 2020/6/25
|
* @day 2020/6/25
|
||||||
*/
|
*/
|
||||||
public function mainGroup($date, $merId, $saleType = 1)
|
public function mainGroup($date, $merId, $saleType = 0)
|
||||||
{
|
{
|
||||||
/** @var UserVisitRepository $userVisitRepository */
|
/** @var UserVisitRepository $userVisitRepository */
|
||||||
$userVisitRepository = app()->make(UserVisitRepository::class);
|
$userVisitRepository = app()->make(UserVisitRepository::class);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user