|
|
|
|
@ -21,6 +21,7 @@ use App\Models\Product;
|
|
|
|
|
use App\Models\Project;
|
|
|
|
|
use App\Models\Recharge;
|
|
|
|
|
use App\Models\Refund;
|
|
|
|
|
use App\Scopes\AdminProjectScope;
|
|
|
|
|
use Carbon\Carbon;
|
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
|
@ -79,7 +80,7 @@ class StatisticsController extends CommonController
|
|
|
|
|
$months = $this->_getMonths();
|
|
|
|
|
|
|
|
|
|
DB::enableQueryLog();
|
|
|
|
|
$paramedics = (new Paramedic())->where(function ($query) use ($project_id, $month) {
|
|
|
|
|
$paramedics = (new Paramedic())->withoutGlobalScope(AdminProjectScope::class)->where(function ($query) use ($project_id, $month) {
|
|
|
|
|
$order_item_paramedic_ids = (new OrderItems())
|
|
|
|
|
->whereRaw("(DATE_FORMAT(`service_date`,'%Y-%m') = '{$month}' or DATE_FORMAT(`paid_at`,'%Y-%m') = '{$month}')")
|
|
|
|
|
->whereHas("order", function ($query) use ($project_id) {
|
|
|
|
|
|