Merge branch 'develop' of https://github.com/nakazawakan/kikikanri into c_account
このコミットが含まれているのは:
コミット
8c6264b9c9
|
@ -180,17 +180,20 @@ class ChildrenController extends Controller {
|
||||||
return ['status_code' => 200, 'params' => $result];
|
return ['status_code' => 200, 'params' => $result];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function listOfFather (Request $r) {
|
public function listOfFather ($father_id) {
|
||||||
|
if (!isset($father_id)) {
|
||||||
|
return ['status_code' => 400];
|
||||||
|
}
|
||||||
$result = [];
|
$result = [];
|
||||||
$child_select = ['id', 'image', 'last_name', 'first_name'];
|
$child_select = ['first_name', 'last_name', 'tel'];
|
||||||
|
|
||||||
if (null === ($list = FatherRelation::select('father_id')->where('father_id', (int)$r->father_id)->orderBy('created_at', 'desc')->get())) {
|
if (null === ($list = FatherRelation::select('child_id')->where('father_id', (int)$father_id)->orderBy('created_at', 'desc')->get())) {
|
||||||
return ['status_code' => 400];
|
return ['status_code' => 400];
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($list as $l) {
|
foreach ($list as $i => $l) {
|
||||||
if (null === ($result[] = Child::select($child_select)->find($l->father_id))) {
|
if (null === ($result[] = Child::select($child_select)->where('id', $l->child_id)->first())) {
|
||||||
return ['status_code' => 400];
|
$result[$i] = [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -526,17 +526,22 @@ class MeetingsController extends Controller {
|
||||||
if (isset($r->pdf)) {
|
if (isset($r->pdf)) {
|
||||||
$filename = uniqid() . '.pdf';
|
$filename = uniqid() . '.pdf';
|
||||||
$pdf = base64_decode(substr($r->pdf, strpos($r->pdf, ',') + 1));
|
$pdf = base64_decode(substr($r->pdf, strpos($r->pdf, ',') + 1));
|
||||||
$update['pdf'] = '/storage/'.$filename;
|
|
||||||
|
|
||||||
if ($chk = Meeting::select('pdf')->where('id', (int)$meeting_id)->first() && strcmp($chk->pdf, $r->pdf) != 0) {
|
if ($chk = Meeting::select('pdf')->where('id', (int)$meeting_id)->first()) {
|
||||||
if (Storage::disk('public')->exists($chk->pdf)) {
|
$opdf = str_replace('/storage/', '', $chk->pdf);
|
||||||
if (Storage::disk('public')->get($chk->pdf) != $pdf) {
|
if (strcmp(Storage::disk('public')->get($opdf), $pdf) !== 0) {
|
||||||
Storage::disk('public')->delete($chk->pdf);
|
if (Storage::disk('public')->exists($opdf)) {
|
||||||
|
Storage::disk('public')->delete($opdf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$update['pdf'] = '/storage/'.$filename;
|
||||||
|
Storage::disk('public')->put($filename, $pdf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
Storage::disk('public')->put($filename, $pdf);
|
$update['pdf'] = '/storage/'.$filename;
|
||||||
|
Storage::disk('public')->put($filename, $pdf);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Meeting::where('id', (int)$meeting_id)->update($update);
|
Meeting::where('id', (int)$meeting_id)->update($update);
|
||||||
|
|
|
@ -10,6 +10,7 @@ server {
|
||||||
index index.php;
|
index index.php;
|
||||||
|
|
||||||
charset utf-8;
|
charset utf-8;
|
||||||
|
client_max_body_size 10M;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
try_files $uri $uri/ /index.php?$query_string;
|
try_files $uri $uri/ /index.php?$query_string;
|
||||||
|
|
新しいイシューから参照