Commit 4dac1879 authored by Kittisak Maneewong's avatar Kittisak Maneewong

Edit

parent de38734c
......@@ -4,6 +4,7 @@ namespace App\Http\Controllers;
use App\Company;
use App\User;
use App\Job;
use Illuminate\Http\Request;
class CompanyController extends Controller
......@@ -85,10 +86,11 @@ class CompanyController extends Controller
public function show($id)
{
$exists = Company::where('user_id', $id)->exists();
$count = Job::where('user_id', $id)->count();
if ($exists) {
return response()->json(['exists' => true, 'company' => Company::where('user_id', $id)->first()]);
return response()->json(['exists' => true, 'company' => Company::where('user_id', $id)->first(), 'count' => $count]);
} else {
return response()->json(['exists' => false, 'company' => User::where('id', $id)->first()]);
return response()->json(['exists' => false, 'company' => User::where('id', $id)->first(), 'count' => $count]);
}
}
......@@ -124,6 +126,8 @@ class CompanyController extends Controller
$name = 'Company'.time().'.'.explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];
\Image::make($request->get('imageCompany'))->save(public_path('uploads/').$name);
$company->imageCompany = '/uploads/'.$name;
} else {
$company->imageCompany = 'https://asianinteriorservices.com/wp-content/uploads/2018/04/noImg.png';
}
}
if ($request->get('imageMap') !== $company->imageMap) {
......@@ -132,6 +136,8 @@ class CompanyController extends Controller
$name = 'Map'.time().'.'.explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];
\Image::make($request->get('imageMap'))->save(public_path('uploads/').$name);
$company->imageMap = '/uploads/'.$name;;
} else {
$company->imageMap = null;
}
}
$company->company_name = $request->get('company_name');
......
......@@ -45,7 +45,7 @@ return [
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
'root' => public_path(''),
],
'public' => [
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -4,7 +4,7 @@
<v-flex xs12 sm10 offset-sm1>
<v-toolbar flat color="white" height="40">
<v-spacer></v-spacer>
<v-btn small="" dark color="deep-orange darken-4" class="elevation-0" @click="$router.push('/employer/login')">สำหรับผู้ประกอบการ</v-btn>
<v-btn small="" dark color="deep-orange darken-4" class="elevation-0" @click="$router.push('/employer')">สำหรับผู้ประกอบการ</v-btn>
<v-divider inset vertical></v-divider>
<v-btn v-if="!currentUser" small outline color="deep-orange darken-4" @click.stop="login()">
<v-icon>person</v-icon>&nbsp;เข้าสู่ระบบ
......
......@@ -136,7 +136,7 @@
label="ระดับการศึกษา"
v-model="job_data.degree"
placeholder=" "
item-value="text"
:items="degree"
></v-select>
<v-text-field
label="เกรดเฉลี่ย "
......@@ -185,6 +185,9 @@
export default {
data () {
return {
degree: [
'ระดับ'
],
gender: [],
items: [
'ชาย',
......
......@@ -136,7 +136,7 @@
label="ระดับการศึกษา"
v-model="job_data.degree"
placeholder=" "
item-value="text"
:items="degree"
></v-select>
<v-text-field
label="เกรดเฉลี่ย "
......@@ -185,6 +185,9 @@
export default {
data () {
return {
degree: [
'ระดับ'
],
gender: [],
items: [
'ชาย',
......
......@@ -41,7 +41,7 @@
งานทั้งหมด
</v-flex>
<v-flex xs12 sm12 class="subheading font-weight-black" >
0 งาน
{{countJob}} งาน
</v-flex>
</v-flex>
<v-flex xs4 sm1 class="text-sm-center text-xs-center">
......@@ -52,7 +52,7 @@
งานที่เปิดรับสมัคร
</v-flex>
<v-flex xs12 sm12 class="subheading font-weight-black" >
0 งาน
{{countJob}} งาน
</v-flex>
</v-flex>
<v-flex xs4 sm1 class="text-sm-center text-xs-center">
......@@ -122,6 +122,7 @@ export default {
data () {
return {
user: null,
countJob: 0,
companies: {
about: null,
addr: null,
......@@ -166,6 +167,7 @@ export default {
axios.get(`/api/companys/${res.id}`)
.then(res => {
console.log(res)
this.countJob = res.data.count
if (res.data.exists) {
this.companies = res.data.company
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment