mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-10-26 09:12:52 -04:00 
			
		
		
		
	
						commit
						e700ac3095
					
				| @ -53,7 +53,6 @@ class SchedulerCheck implements ShouldQueue | |||||||
| 
 | 
 | ||||||
|             try { |             try { | ||||||
|                 Artisan::call('clear-compiled'); |                 Artisan::call('clear-compiled'); | ||||||
|                 Artisan::call('cache:clear'); |  | ||||||
|                 Artisan::call('route:clear'); |                 Artisan::call('route:clear'); | ||||||
|                 Artisan::call('config:cache'); |                 Artisan::call('config:cache'); | ||||||
|             } catch (\Exception $e) { |             } catch (\Exception $e) { | ||||||
|  | |||||||
| @ -128,6 +128,11 @@ class Credit extends BaseModel | |||||||
|         return $this->hasManyThrough(Backup::class, Activity::class); |         return $this->hasManyThrough(Backup::class, Activity::class); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     public function activities() | ||||||
|  |     { | ||||||
|  |         return $this->hasMany(Activity::class)->orderBy('id', 'DESC')->take(300); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     public function company() |     public function company() | ||||||
|     { |     { | ||||||
|         return $this->belongsTo(Company::class); |         return $this->belongsTo(Company::class); | ||||||
|  | |||||||
| @ -204,7 +204,7 @@ class Invoice extends BaseModel | |||||||
| 
 | 
 | ||||||
|     public function activities() |     public function activities() | ||||||
|     { |     { | ||||||
|         return $this->hasMany(Activity::class); |         return $this->hasMany(Activity::class)->orderBy('id', 'DESC')->take(300); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     public function history() |     public function history() | ||||||
|  | |||||||
| @ -130,6 +130,11 @@ class Quote extends BaseModel | |||||||
|         return $this->hasManyThrough(Backup::class, Activity::class); |         return $this->hasManyThrough(Backup::class, Activity::class); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     public function activities() | ||||||
|  |     { | ||||||
|  |         return $this->hasMany(Activity::class)->orderBy('id', 'DESC')->take(300); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     public function user() |     public function user() | ||||||
|     { |     { | ||||||
|         return $this->belongsTo(User::class)->withTrashed(); |         return $this->belongsTo(User::class)->withTrashed(); | ||||||
|  | |||||||
| @ -71,26 +71,26 @@ class Statics | |||||||
| 
 | 
 | ||||||
|         foreach (config('ninja.cached_tables') as $name => $class) { |         foreach (config('ninja.cached_tables') as $name => $class) { | ||||||
| 
 | 
 | ||||||
|             if (!Cache::has($name)) { |             // if (!Cache::has($name)) {
 | ||||||
| 
 | 
 | ||||||
|                 // check that the table exists in case the migration is pending
 |             //     // check that the table exists in case the migration is pending
 | ||||||
|                 if (!Schema::hasTable((new $class())->getTable())) { |             //     if (!Schema::hasTable((new $class())->getTable())) {
 | ||||||
|                     continue; |             //         continue;
 | ||||||
|                 } |             //     }
 | ||||||
|                 if ($name == 'payment_terms') { |             //     if ($name == 'payment_terms') {
 | ||||||
|                     $orderBy = 'num_days'; |             //         $orderBy = 'num_days';
 | ||||||
|                 } elseif ($name == 'fonts') { |             //     } elseif ($name == 'fonts') {
 | ||||||
|                     $orderBy = 'sort_order'; |             //         $orderBy = 'sort_order';
 | ||||||
|                 } elseif (in_array($name, ['currencies', 'industries', 'languages', 'countries', 'banks'])) { |             //     } elseif (in_array($name, ['currencies', 'industries', 'languages', 'countries', 'banks'])) {
 | ||||||
|                     $orderBy = 'name'; |             //         $orderBy = 'name';
 | ||||||
|                 } else { |             //     } else {
 | ||||||
|                     $orderBy = 'id'; |             //         $orderBy = 'id';
 | ||||||
|                 } |             //     }
 | ||||||
|                 $tableData = $class::orderBy($orderBy)->get(); |             //     $tableData = $class::orderBy($orderBy)->get();
 | ||||||
|                 if ($tableData->count()) { |             //     if ($tableData->count()) {
 | ||||||
|                     Cache::forever($name, $tableData); |             //         Cache::forever($name, $tableData);
 | ||||||
|                 } |             //     }
 | ||||||
|             } |             // }
 | ||||||
| 
 | 
 | ||||||
|             $data[$name] = Cache::get($name); |             $data[$name] = Cache::get($name); | ||||||
|         } |         } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user