File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -53,11 +53,13 @@ public function handle($request, Closure $next)
5353 $ installIdSetting = Setting::where ([
5454 'name ' => 'install_id ' ,
5555 ])->first ();
56-
57- $ userCount = User::where ('crm_access ' , 1 )->count ();
58-
59- if ($ userCount == 0 ) {
60- $ userCount = 1 ;
56+
57+ if (Schema::hasColumn (config ('laravel-crm.db_table_prefix ' ).'settings ' , 'crm_access ' )) {
58+ $ userCount = User::where ('crm_access ' , 1 )->count ();
59+
60+ if ($ userCount == 0 ) {
61+ $ userCount = 1 ;
62+ }
6163 }
6264
6365 $ response = $ client ->request ('POST ' , $ url , [
@@ -69,7 +71,7 @@ public function handle($request, Closure $next)
6971 'version ' => config ('laravel-crm.version ' ) ?? null ,
7072 'server_ip ' => request ()->server ('SERVER_ADDR ' ) ?? null ,
7173 'user_ip ' => request ()->ip () ?? null ,
72- 'user_count ' => $ userCount ,
74+ 'user_count ' => $ userCount ?? 1 ,
7375 ],
7476 ]);
7577
You can’t perform that action at this time.
0 commit comments