mutations() {
return {
id: (id) => String(id) || null,
serial: Number,
date: String,
salary: Number,
status: Number,
supplies: (supplies) => {
if(Array.isArray(supplies)){
return new SupplyCollection(supplies)
}else if(supplies instanceof SupplyCollection){
return supplies;
}
return new SupplyCollection();
},
materials: (materials) => {
if(Array.isArray(materials)){
return new MaterialCollection(materials)
}else if(materials instanceof MaterialCollection){
return materials;
}
return new MaterialCollection();
},
}
}
FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream
server {
listen 80 default_server;
server_name localhost;
root /app/src;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
location /api {
root /app/src;
index index.php index.html index.htm;
try_files $uri /api/index.php$is_args$args;
location ~ \.php$ {
fastcgi_pass api:9000;
include fastcgi_params;
fastcgi_split_path_info ^(?:\/api\/)(.+\.php)(.*)$;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /app/src/index.php;
}
}
location / {
proxy_pass http://web:80;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
break;
}
}
git init
git remote add origin адрес_репозитория
git checkout new_styles
<?php
$dir = 'директория';
exec("cd $dir && git pull 2>&1", $output);
?>
public function exceptChild($data,$rootID){
foreach($data as $id => $node){
if($node->parent_id == $rootID){
unset($data[$id]);
$data = $this->exceptChild($data,$node->id);
}
}
return $data;
}
$data = $model->exceptChild($model->findAll('id !='.$id),$id);