@@ -35,19 +35,19 @@ |
||
| 35 | 35 | people.titl AS title, people.givn, people.surn, people.appellative, people.email, people.phone, |
| 36 | 36 | people.birthday, people.deathday, CASE WHEN users.id is null THEN 0 ELSE 1 END as "user", |
| 37 | 37 | companies.name as company, people.created_at |
| 38 | - ')->leftJoin('users', function ($join) use ($userId) { |
|
| 38 | + ')->leftJoin('users', function($join) use ($userId) { |
|
| 39 | 39 | $join->on('people.id', '=', 'users.person_id') |
| 40 | 40 | ->where('users.id', $userId); |
| 41 | 41 | }) |
| 42 | 42 | ->leftJoin( |
| 43 | 43 | 'company_person', |
| 44 | - function ($join) use ($userId) { |
|
| 44 | + function($join) use ($userId) { |
|
| 45 | 45 | $join |
| 46 | 46 | ->on('people.id', '=', 'company_person.person_id') |
| 47 | 47 | ->where('company_person.company_id', $userId) |
| 48 | 48 | ->where('company_person.is_main', true); |
| 49 | 49 | } |
| 50 | - )->leftJoin('companies', function ($join) use ($userId) { |
|
| 50 | + )->leftJoin('companies', function($join) use ($userId) { |
|
| 51 | 51 | $join->on('company_person.company_id', '=', 'companies.id') |
| 52 | 52 | ->where('companies.id', $userId); |
| 53 | 53 | }); |
@@ -12,10 +12,10 @@ |
||
| 12 | 12 | |
| 13 | 13 | public function query(): Builder |
| 14 | 14 | { |
| 15 | - return Family::leftJoin('people as husband', function ($join) { |
|
| 15 | + return Family::leftJoin('people as husband', function($join) { |
|
| 16 | 16 | $join->on('husband.id', '=', 'families.husband_id'); |
| 17 | 17 | }) |
| 18 | - ->leftJoin('people as wife', function ($join) { |
|
| 18 | + ->leftJoin('people as wife', function($join) { |
|
| 19 | 19 | $join->on('wife.id', '=', 'families.wife_id'); |
| 20 | 20 | }) |
| 21 | 21 | ->select(\DB::raw(' |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | $recordsSince = TenantPerson::orderBy('updated_at', 'desc')->first()?->updated_at; |
| 34 | 34 | $this->info('Tenant people records syncronization since: '.($recordsSince ?: 'start')); |
| 35 | 35 | |
| 36 | - tenancy()->query()->cursor()->each(function (Tenant $tenant) use ($recordsSince) { |
|
| 36 | + tenancy()->query()->cursor()->each(function(Tenant $tenant) use ($recordsSince) { |
|
| 37 | 37 | try { |
| 38 | 38 | tenancy()->initialize($tenant); |
| 39 | 39 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | $this->info('Processing tenant #'.$tenant->id.' records: '.(clone $tenantPersonQuery)->count()); |
| 47 | - $tenantPersonQuery->chunk(100, function ($people) use ($tenant) { |
|
| 47 | + $tenantPersonQuery->chunk(100, function($people) use ($tenant) { |
|
| 48 | 48 | // clear old records and push updated ones |
| 49 | 49 | TenantPerson::where('tenant_id', $tenant->id) |
| 50 | 50 | ->whereIn('tenant_person_id', $people->pluck('id')) |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | $user = User::where('stripe_id', $data['data']['object']['customer'])->first(); |
| 37 | 37 | if ($user) { |
| 38 | 38 | $plan_nickname = $data['data']['object']['plan']['nickname']; |
| 39 | - $roles= Role::where('name', strtolower($plan_nickname))->first(); |
|
| 39 | + $roles = Role::where('name', strtolower($plan_nickname))->first(); |
|
| 40 | 40 | if ($roles) { |
| 41 | 41 | $user->role_id = $roles->id; |
| 42 | 42 | $user->save(); |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | $user = User::where('stripe_id', $data['data']['object']['customer'])->first(); |
| 49 | 49 | if ($user) { |
| 50 | 50 | $plan_nickname = $data['data']['object']['lines']['data'][0]['plan']['nickname']; |
| 51 | - $roles= Role::where('name', strtolower($plan_nickname))->first(); |
|
| 51 | + $roles = Role::where('name', strtolower($plan_nickname))->first(); |
|
| 52 | 52 | if ($roles) { |
| 53 | 53 | $user->role_id = $roles->id; |
| 54 | 54 | $user->save(); |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | case "invoice.payment_failed" : |
| 59 | 59 | $user = User::where('stripe_id', $data['data']['object']['customer'])->first(); |
| 60 | 60 | if ($user) { |
| 61 | - $roles= Role::where('name', strtolower("free"))->first(); |
|
| 61 | + $roles = Role::where('name', strtolower("free"))->first(); |
|
| 62 | 62 | if ($roles) { |
| 63 | 63 | $user->role_id = $roles->id; |
| 64 | 64 | $user->save(); |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | $result = exec('python3 dna.py '.$this->var_name.' '.$dna->variable_name.' '.$this->file_name.' '.$dna->file_name); |
| 53 | 53 | // $resultData = json_decode($result, true, 512, JSON_THROW_ON_ERROR); |
| 54 | 54 | $resultData = json_decode($result, true); |
| 55 | - // chmod(storage_path('/app/public/dna/output/shared_dna_'.$this->var_name.'_'.$dna->variable_name.'_'.$this->file_name.'_'.$dna->file_name), 0777); |
|
| 55 | + // chmod(storage_path('/app/public/dna/output/shared_dna_'.$this->var_name.'_'.$dna->variable_name.'_'.$this->file_name.'_'.$dna->file_name), 0777); |
|
| 56 | 56 | |
| 57 | 57 | $dm = new DM(); |
| 58 | 58 | $dm->user_id = $user->id; |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | // $dm->image = 'shared_dna_'.$this->var_name.'_'.$dna->variable_name.'.png'; |
| 64 | 64 | // $dm->image = 'shared_dna_'.$this->var_name.'_'.$dna->variable_name.'_0p75cM_1100snps_GRCh37_HapMap2.png'; |
| 65 | 65 | $dm->image = env('APP_URL').'/storage/dna/output/shared_dna_'.$this->var_name.'_'. |
| 66 | - $dna->variable_name.'_0p75cM_1100snps_GRCh37_HapMap2.png'; |
|
| 66 | + $dna->variable_name.'_0p75cM_1100snps_GRCh37_HapMap2.png'; |
|
| 67 | 67 | // $dm->file1 = 'discordant_snps_'.$this->var_name.'_'.$dna->variable_name.'_GRCh37.csv'; |
| 68 | 68 | $dm->file1 = 'discordant_snps_'.$this->var_name.'_'.$dna->variable_name.'_GRCh37.csv'; |
| 69 | 69 | // $dm->file2 = 'shared_dna_one_chrom_'.$this->var_name.'_'.$dna->variable_name.'_GRCh37.csv'; |
@@ -68,7 +68,7 @@ |
||
| 68 | 68 | // Log::info("content from getGedcomPerson function => \n $content"); |
| 69 | 69 | // var_dump(\Storage::disk('public')->path($this->file), "job"); |
| 70 | 70 | $manager->storage()->put($this->file, $content); |
| 71 | - // $filePath = 'public/' . $this->file; |
|
| 71 | + // $filePath = 'public/' . $this->file; |
|
| 72 | 72 | // $filePath = $manager->storage()->path($filePath); |
| 73 | 73 | // chmod_r('/home/genealogia/domains/api.genealogia.co.uk/genealogy/storage/tenants/'); |
| 74 | 74 | exec("chmod -R 0777 ". storage_path('/tenants/')); |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | public function handle() |
| 36 | 36 | { |
| 37 | 37 | $p_id = $this->user->person_id; // person_id |
| 38 | - $f_id = 0; // family_id |
|
| 38 | + $f_id = 0; // family_id |
|
| 39 | 39 | |
| 40 | 40 | // $tenant = Manager::fromModel($this->user->company(), $this->user); |
| 41 | 41 | // $tenant->connect(); |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | $person = Person::where("child_in_family_id", $this->user->id)->first(); |
| 49 | 49 | |
| 50 | 50 | if ($person != null) { |
| 51 | - $f_id=$person->child_in_family_id; |
|
| 51 | + $f_id = $person->child_in_family_id; |
|
| 52 | 52 | } else { |
| 53 | 53 | $f_id = 0; |
| 54 | 54 | } |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | // $filePath = 'public/' . $this->file; |
| 72 | 72 | // $filePath = $manager->storage()->path($filePath); |
| 73 | 73 | // chmod_r('/home/genealogia/domains/api.genealogia.co.uk/genealogy/storage/tenants/'); |
| 74 | -exec("chmod -R 0777 ". storage_path('/tenants/')); |
|
| 74 | +exec("chmod -R 0777 ".storage_path('/tenants/')); |
|
| 75 | 75 | //exec ("find /home/genealogia/ap -type d -exec chmod 0750 {} +"); |
| 76 | 76 | //exec ("find /path/to/folder -type f -exec chmod 0644 {} +"); |
| 77 | 77 | // var_dump($path,'path'); |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | $manager = Manager::fromModel($request->user()->company(), $request->user()); |
| 24 | 24 | ExportGedCom::dispatchSync($filePath, $request->user()); |
| 25 | 25 | |
| 26 | - $filePath = $manager->storage()->path($filePath); |
|
| 26 | + $filePath = $manager->storage()->path($filePath); |
|
| 27 | 27 | Log::info("Read gedfile from ". $manager->storage()->path($filePath)); |
| 28 | 28 | // var_dump($filePath); |
| 29 | 29 | return json_encode([ |
@@ -19,12 +19,12 @@ |
||
| 19 | 19 | $file = env('APP_NAME').date('_Ymd_').$ts.'.ged'; |
| 20 | 20 | $file = str_replace(' ', '', $file); |
| 21 | 21 | $file = str_replace("'", '', $file); |
| 22 | - $filePath = 'public/' . $file; |
|
| 22 | + $filePath = 'public/'.$file; |
|
| 23 | 23 | $manager = Manager::fromModel($request->user()->company(), $request->user()); |
| 24 | 24 | ExportGedCom::dispatchSync($filePath, $request->user()); |
| 25 | 25 | |
| 26 | 26 | $filePath = $manager->storage()->path($filePath); |
| 27 | - Log::info("Read gedfile from ". $manager->storage()->path($filePath)); |
|
| 27 | + Log::info("Read gedfile from ".$manager->storage()->path($filePath)); |
|
| 28 | 28 | // var_dump($filePath); |
| 29 | 29 | return json_encode([ |
| 30 | 30 | // 'file' => $manager->storage()->path($filePath) , |