shaunakwyn / gTalents

it contains gTalents files repository...
0 stars 0 forks source link

[ issue #12 ] Commissions per User #2

Open shaunakwyn opened 4 years ago

shaunakwyn commented 4 years ago

[File]

/home/gtalents/public_html/alpha/app/Repositories/Category/EloquentCategory.php

[Changes]

in findbyname() :
{code}
    return Category::where('name', $name)->firstorfail();
{code}
shaunakwyn commented 4 years ago

[File]

/home/gtalents/public_html/alpha/app/Http/Controllers/VacancyController.php

[Changes]

Add this to include category repository...
{code}
        use Vanguard\Repositories\Category\CategoryRepository;
{code}
public function __construct(  CategoryRepository $categories ){
        $this->categories = $categories;
}
in show_post_user() :
{code}
    $userposition = Auth::user()->company[0]->category->name;
    $userLevel = $this->categories->findbyname($userposition);
    &
        return view('dashboard_user.post.post_user',compact('userLevel')) ;
    return view('dashboard_user.post.post_supplier',compact('userLevel')) ;
{code}
shaunakwyn commented 4 years ago

[File]

/home/gtalents/public_html/alpha/resources/views/dashboard_user/post/post_supplier.blade.php

[Changes]

{code}
    Place "$userLevel" instead of "$userCategorie"
{code}
shaunakwyn commented 4 years ago

[File]

/home/gtalents/public_html/resources/views/dashboard_user/post/post_user.blade.php

[Changes]

{code}
    Place "$userLevel" instead of "$userCategorie"
{code}
shaunakwyn commented 4 years ago

[File]

/home/gtalents/public_html/alpha/app/Http/Viewcomposers/VacancyComposer.php

[Changes]

in compose() : 
{code}
try{
       preg_match_all('/\d{1,3}/' ,$vacancy->range_salary, $matches);
            $matches=$matches[0];
            $as = ((intval($matches[0]).'000')+(intval($matches[1]).'000'))/2;
            if($vacancy->group1==1) {
                $factura = ($vacancy->fee * $as) / 100;
                $factura = number_format($factura, 2, '.', ',');
            } else {
                $factura = intval($vacancy->fee);
            }
        } catch (\Exception $e){
            $factura = '';
        }
{code}
roberto-robles commented 4 years ago

https://github.com/roberto-robles/gtalents-code/pull/6 this is already merged here, thanks