|
|
|
|
@ -14,6 +14,7 @@ use App\Models\ProductItems;
|
|
|
|
|
use App\Models\Project;
|
|
|
|
|
use App\Models\Refund;
|
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
|
use Illuminate\Support\Facades\Cache;
|
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
|
use Spatie\Permission\Models\Role;
|
|
|
|
|
|
|
|
|
|
@ -66,7 +67,10 @@ class HomeController extends CommonController
|
|
|
|
|
$productItem = ProductItems::where('product_id', $product->id)->get();
|
|
|
|
|
$factor = FactorItems::where('factor_id', $product->statistic_factor_id)->get();
|
|
|
|
|
$order_total = OrderItems::whereIn('product_item_id', $productItem->pluck('id'))->sum('total');
|
|
|
|
|
$lies = $this->getLies($productItem, $factor, $order_total);
|
|
|
|
|
|
|
|
|
|
$lies = Cache::remember('lies', 24 * 60 * 60, function () use ($productItem,$factor,$order_total) {
|
|
|
|
|
return $this->getLies($productItem, $factor, $order_total);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$allMontn = [
|
|
|
|
|
date("Y") . '-01',
|
|
|
|
|
|