Fix Alert && Fix enablelimitprinting
This commit is contained in:
parent
5dddac6371
commit
72a4e0c35c
3 changed files with 11 additions and 6 deletions
|
|
@ -94,17 +94,22 @@ class Kernel extends ConsoleKernel
|
|||
// ---- Sauvegarde des stats tous les jours a 23:45
|
||||
$schedule->call(function () {
|
||||
$last_stat = Statistique::orderBy('created_at', 'DESC')->first();
|
||||
if(isset($last_stat->created_at)){
|
||||
$dateStart = $last_stat->created_at;
|
||||
} else {
|
||||
$dateStart = Carbon::now()->setTime(0,0,0)->subMonth()->format('Y-m-d H:i:s');
|
||||
}
|
||||
$campagnes = Campagne::all();
|
||||
foreach ($campagnes as $campagne) {
|
||||
$coupons = $campagne->coupons()->get();
|
||||
foreach ($coupons as $coupon) {
|
||||
if ($campagne->camp_type == 0 || $campagne->camp_type == 2) { //Calcul des BR consommé pour les murs
|
||||
$count = Mur::where(['mur_couponId' => $coupon->coupon_id, 'mur_campid' => $campagne->camp_id])->whereBetween('mur_createdate', [$last_stat->created_at, Carbon::now()->setTime(23,59,59)->format('Y-m-d H:i:s')])->count();
|
||||
$count = Mur::where(['mur_couponId' => $coupon->coupon_id, 'mur_campid' => $campagne->camp_id])->whereBetween('mur_createdate', [$dateStart, Carbon::now()->setTime(23,59,59)->format('Y-m-d H:i:s')])->count();
|
||||
} else { //Calcul des BR consommé pour les paniers
|
||||
$count = 0;
|
||||
$paniers = Panier::where('panier_campId', $campagne->camp_id)->where(function($query){
|
||||
$query->whereBetween('panier_createdate', [$last_stat->created_at, Carbon::now()->setTime(23,59,59)->format('Y-m-d H:i:s')])
|
||||
->orWhereBetween('panier_updatedate', [$last_stat->created_at, Carbon::now()->setTime(23,59,59)->format('Y-m-d H:i:s')]);
|
||||
$query->whereBetween('panier_createdate', [$dateStart, Carbon::now()->setTime(23,59,59)->format('Y-m-d H:i:s')])
|
||||
->orWhereBetween('panier_updatedate', [$dateStart, Carbon::now()->setTime(23,59,59)->format('Y-m-d H:i:s')]);
|
||||
})->get();
|
||||
foreach ($paniers as $panier) {
|
||||
$panierContentCount = $panier->panierContents()->where(['panier_content_couponId' => $coupon->coupon_id])->sum('panier_content_printed');
|
||||
|
|
|
|||
2
public/js/app.js
vendored
2
public/js/app.js
vendored
File diff suppressed because one or more lines are too long
4
resources/js/app.js
vendored
4
resources/js/app.js
vendored
|
|
@ -178,7 +178,7 @@ $( window ).resize(function() {
|
|||
});
|
||||
|
||||
$('#camp_type').on('change', function(event){
|
||||
if($(this).val() == 1){
|
||||
if($(this).val() == 1 || $(this).val() == 3){
|
||||
$('.limitPrinting').css('opacity', '1');
|
||||
} else {
|
||||
$('.limitPrinting').css('opacity', '0');
|
||||
|
|
@ -210,7 +210,7 @@ $('#coupon_norme').on('change', function(event){
|
|||
});
|
||||
|
||||
$(document).ready(function(){
|
||||
if($('#camp_type').val() == 2){
|
||||
if($('#camp_type').val() == 1 || $('#camp_type').val() == 3){
|
||||
$('.limitPrinting').css('opacity', '1');
|
||||
}
|
||||
if($('#coupon_enablelimitquantity').is(':checked')){
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue