worked on the new onboarding steps
This commit is contained in:
@@ -17,6 +17,14 @@ class Client extends Model
|
||||
$indicator_score = (count($current_indicator_count)/$general_indicators) * 100;
|
||||
return number_format($indicator_score);
|
||||
}
|
||||
|
||||
|
||||
public function getOnboardingProgressStageAttribute($value){
|
||||
$onboarding_stage = json_decode($value, true);
|
||||
|
||||
// $indicator_score = (count($current_indicator_count)/$general_indicators) * 100;
|
||||
return $onboarding_stage[0];
|
||||
}
|
||||
*/
|
||||
public function country_info(){
|
||||
return $this->hasOne('App\Models\Country', 'alpha_2_code', 'country');
|
||||
|
||||
10
app/Models/ClientOnboardingMainStage.php
Normal file
10
app/Models/ClientOnboardingMainStage.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ClientOnboardingMainStage extends Model
|
||||
{
|
||||
//
|
||||
}
|
||||
17
app/Models/ClientOnboardingProgress.php
Normal file
17
app/Models/ClientOnboardingProgress.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ClientOnboardingProgress extends Model
|
||||
{
|
||||
protected $guarded = array('id');
|
||||
public $table = "client_onboarding_progress";
|
||||
|
||||
public function stage_info(){
|
||||
return $this->hasOne('App\Models\ClientOnboardingMainStage', 'stage_id', 'id');
|
||||
}
|
||||
//this will produce one stage
|
||||
//I need a relationship to show all sub items
|
||||
}
|
||||
11
app/Models/ClientOnboardingStage.php
Normal file
11
app/Models/ClientOnboardingStage.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ClientOnboardingStage extends Model
|
||||
{
|
||||
protected $guarded = array('id');
|
||||
public $table = "client_onboarding_main_stages";
|
||||
}
|
||||
10
app/Models/ClientOnboardingSubItem.php
Normal file
10
app/Models/ClientOnboardingSubItem.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ClientOnboardingSubItem extends Model
|
||||
{
|
||||
//
|
||||
}
|
||||
16
app/Models/LoggedUser.php
Normal file
16
app/Models/LoggedUser.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class LoggedUser extends Model
|
||||
{
|
||||
protected $guarded = array('id');
|
||||
public $table = "logged_users";
|
||||
|
||||
|
||||
public function auth_user_info(){
|
||||
return $this->hasOne('App\Models\Account', 'id', 'user_id');
|
||||
}
|
||||
}
|
||||
10
app/Models/OnboardingStage.php
Normal file
10
app/Models/OnboardingStage.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class OnboardingStage extends Model
|
||||
{
|
||||
protected $guarded = array('id');
|
||||
}
|
||||
@@ -3,9 +3,22 @@
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class UserActivity extends Model
|
||||
{
|
||||
protected $guarded = array('id');
|
||||
public $table = "user_activities";
|
||||
// protected $appends = ['activity_time'];
|
||||
|
||||
public function userInfo(){
|
||||
return $this->hasOne('App\Models\StaffMember', 'id', 'user_id');
|
||||
}
|
||||
public function getActivityTimeAttribute(){
|
||||
$created = $this->created_at;
|
||||
$parsed_created_date = Carbon::parse($created);
|
||||
$current_date = Carbon::parse(date('Y-m-d'));
|
||||
$days = $parsed_created_date->diffForHumans();
|
||||
return $days;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,8 +8,10 @@ class UssdClientPayment extends Model
|
||||
{
|
||||
protected $guarded = array('id');
|
||||
public $table = "ussd_client_payments";
|
||||
|
||||
|
||||
public function client_info(){
|
||||
return $this->hasOne('App\Models\Client', 'id', 'client_id');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user