Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
CO-OP Search
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kittisak Maneewong
CO-OP Search
Commits
9526419d
Commit
9526419d
authored
Apr 22, 2019
by
Kittisak Maneewong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update company
parent
3ee5840a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
59 additions
and
13 deletions
+59
-13
CompanyController.php
app/Http/Controllers/CompanyController.php
+45
-7
app.js
public/js/app.js
+0
-0
ConfigCompany.vue
resources/js/views/ConfigCompany.vue
+13
-4
Employer.vue
resources/js/views/Employer.vue
+1
-1
api.php
routes/api.php
+0
-1
No files found.
app/Http/Controllers/CompanyController.php
View file @
9526419d
...
...
@@ -14,12 +14,6 @@ class CompanyController extends Controller
* @return \Illuminate\Http\Response
*/
public
function
check
(
$id
)
{
$exists
=
Company
::
where
(
'user_id'
,
$id
)
->
exists
();
return
response
()
->
json
([
'exists'
=>
$exists
]);
}
public
function
index
()
{
}
...
...
@@ -119,7 +113,51 @@ class CompanyController extends Controller
*/
public
function
update
(
Request
$request
,
$id
)
{
return
response
()
->
json
([
'data'
=>
$request
->
all
()]);
$imageCompany
=
null
;
$imageMap
=
null
;
$company
=
Company
::
find
(
$id
);
if
(
$request
->
get
(
'imageCompany'
)
!==
$request
->
get
(
'currentImageCompany'
))
{
if
(
$request
->
get
(
'imageCompany'
)
!==
'https://asianinteriorservices.com/wp-content/uploads/2018/04/noImg.png'
)
{
$image
=
$request
->
get
(
'imageCompany'
);
$name
=
'Company'
.
time
()
.
'.'
.
explode
(
'/'
,
explode
(
':'
,
substr
(
$image
,
0
,
strpos
(
$image
,
';'
)))[
1
])[
1
];
\Image
::
make
(
$request
->
get
(
'imageCompany'
))
->
save
(
public_path
(
'uploads/'
)
.
$name
);
$imageCompany
=
'/uploads/'
.
$name
;
}
}
else
{
$imageCompany
=
$request
->
get
(
'imageCompany'
);
}
if
(
$request
->
get
(
'imageMap'
)
!==
$request
->
get
(
'currentImageMap'
))
{
if
(
$request
->
get
(
'imageMap'
))
{
$image
=
$request
->
get
(
'imageMap'
);
$name
=
'Map'
.
time
()
.
'.'
.
explode
(
'/'
,
explode
(
':'
,
substr
(
$image
,
0
,
strpos
(
$image
,
';'
)))[
1
])[
1
];
\Image
::
make
(
$request
->
get
(
'imageMap'
))
->
save
(
public_path
(
'uploads/'
)
.
$name
);
$imageMap
=
'/uploads/'
.
$name
;
}
}
else
{
$imageMap
=
$request
->
get
(
'imageMap'
);
}
$company
->
company_name
=
$request
->
get
(
'company_name'
);
$company
->
company_owner
=
$request
->
get
(
'company_owner'
);
$company
->
phone_no
=
$request
->
get
(
'phone_no'
);
$company
->
email
=
$request
->
get
(
'email'
);
$company
->
fax
=
$request
->
get
(
'fax'
);
$company
->
website
=
$request
->
get
(
'website'
);
$company
->
addr
=
$request
->
get
(
'addr'
);
$company
->
tambon
=
$request
->
get
(
'tumbon'
);
$company
->
amphoe
=
$request
->
get
(
'amphoe'
);
$company
->
province
=
$request
->
get
(
'province'
);
$company
->
zipcode
=
$request
->
get
(
'zip_code'
);
$company
->
imageCompany
=
$imageCompany
;
$company
->
imageMap
=
$imageMap
;
$company
->
lat
=
$request
->
get
(
'lat'
);
$company
->
long
=
$request
->
get
(
'lng'
);
$company
->
about
=
$request
->
get
(
'about'
);
$company
->
bts
=
$request
->
get
(
'bts'
);
$company
->
mrt
=
$request
->
get
(
'mrt'
);
$company
->
arl
=
$request
->
get
(
'arl'
);
$company
->
bus
=
$request
->
get
(
'bus'
);
$company
->
another
=
$request
->
get
(
'another'
);
$company
->
save
();
}
/**
...
...
public/js/app.js
View file @
9526419d
This source diff could not be displayed because it is too large. You can
view the blob
instead.
resources/js/views/ConfigCompany.vue
View file @
9526419d
...
...
@@ -418,7 +418,16 @@ export default {
this
.
company_data
.
amphoe
=
this
.
amphoe
.
amphoe
this
.
company_data
.
tumbon
=
this
.
tumbon
.
tumbon
if
(
this
.
company_data
.
exists
)
{
console
.
log
(
'true'
)
axios
.
put
(
`/api/companys/
${
this
.
company_data
.
user_id
}
`
,
this
.
company_data
)
.
then
(
res
=>
{
this
.
$router
.
push
(
'/employer'
)
this
.
loading
=
false
console
.
log
(
res
)
})
.
catch
(
err
=>
{
this
.
loading
=
false
console
.
log
(
err
.
response
)
})
}
else
{
console
.
log
(
false
)
axios
.
post
(
'/api/companys'
,
this
.
company_data
)
...
...
@@ -510,8 +519,8 @@ export default {
console
.
log
(
res
)
const
data
=
res
.
data
.
company
if
(
res
.
data
.
exists
)
{
this
.
company_data
.
currentImageCompany
=
res
.
data
.
imageCompany
this
.
company_data
.
currentImageMap
=
res
.
data
.
imageMap
this
.
company_data
.
currentImageCompany
=
data
.
imageCompany
this
.
company_data
.
currentImageMap
=
data
.
imageMap
this
.
company_data
.
exists
=
res
.
data
.
exists
this
.
company_data
.
about
=
data
.
about
this
.
company_data
.
addr
=
data
.
addr
...
...
@@ -530,7 +539,7 @@ export default {
this
.
company_data
.
mrt
=
data
.
mrt
this
.
company_data
.
phone_no
=
data
.
phone_no
this
.
company_data
.
website
=
data
.
website
this
.
company_data
.
user_id
=
data
.
user_
id
this
.
company_data
.
user_id
=
data
.
id
if
(
this
.
company_data
.
lat
)
{
this
.
place
=
'_'
;
}
...
...
resources/js/views/Employer.vue
View file @
9526419d
...
...
@@ -106,7 +106,7 @@
<label
class=
"caption"
><v-icon
small
>
print
</v-icon>
แฟกซ์. :
{{
companies
.
fax
?
companies
.
fax
:
' - '
}}
</label>
</v-flex>
<v-flex
xs12
sm12
>
<v-btn
small
depressed
dark
color=
"red"
@
click=
"$router.push('/employer/
edit
company')"
>
<v-btn
small
depressed
dark
color=
"red"
@
click=
"$router.push('/employer/
config
company')"
>
<v-icon
dark
>
settings
</v-icon>
แก้ไขข้อมูล
</v-btn>
</v-flex>
...
...
routes/api.php
View file @
9526419d
...
...
@@ -20,7 +20,6 @@ Route::group(['prefix' => 'auth'], function ($router) {
});
Route
::
resource
(
'/companys'
,
'CompanyController'
);
Route
::
get
(
'/companys/{company}/check'
,
'CompanyController@check'
)
->
name
(
'companys.check'
);
Route
::
get
(
'/province'
,
'DistrictController@provinces'
);
Route
::
get
(
'/province/{province_code}/amphoe'
,
'DistrictController@amphoes'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment