master
cody 3 weeks ago
parent fb49707d54
commit 3e77995ed5

@ -43,7 +43,7 @@ class UpdateCompany extends Command
public function handle()
{
$user_id = $this->option('user_id');
$updateLocal = (int) $this->option('address');
$updateLocal = (int)$this->option('address');
// 更新公司信息
$this->compnay($user_id);
// 更新经纬度信息(可选)
@ -121,6 +121,8 @@ class UpdateCompany extends Command
'update_date' => $result['updatedDate'] ?? null,
// 管理平台
'project_users' => $result['projectUsers'] ?? null,
// 股东信息
'partners' => $result['partners'] ?? null,
];
$company = Company::updateOrCreate($where, $data);
// 更新用户关联

@ -5,9 +5,9 @@ namespace App\Models;
class Company extends SoftDeletesModel
{
protected $casts = ['project_users' => 'json'];
protected $casts = ['project_users' => 'json', 'partners' => 'json'];
protected $appends = ['management_platform', 'project_manager'];
protected $appends = ['management_platform', 'project_manager', 'invest_date'];
/**
* 管理平台
@ -38,6 +38,21 @@ class Company extends SoftDeletesModel
return null;
}
/**
* 出资时间
* @return string|null
*/
public function getInvestDateAttribute()
{
$projectUsers = $this->project_users;
if ($projectUsers) {
$investDateArray = array_column($projectUsers, 'investDate');
$investDate = implode(',', $investDateArray);
return $investDate;
}
return null;
}
public function users()
{
return $this->hasMany(User::class, 'company_id', 'id');

@ -1,52 +0,0 @@
#!/bin/bash
# 定义1个变量变量是git裸仓库名字例如/www/git/demo.git
<<<<<<< HEAD
GIT_REPO_NAME="/www/git/wx.sstbc.com.git"
=======
GIT_REPO_NAME="/data/git/wx.sstbc.com.git"
>>>>>>> 8508a4aca7d83d334aa2ec18b4291c6d5750a769
#检测系统里是否存在用户名是git的用户如果不存在就创建一个并且设置密码为git@2023
if ! id -u git > /dev/null 2>&1; then
useradd git
echo "已创建用户 git"
echo git:git@2023 | chpasswd
echo "密码已设置为 Git@2018"
else
echo "git用户已存在"
fi
# 检测系统里是否存在git用户组如果不存在就创建一个并把git用户加入git用户组
if grep "^git:" /etc/group >/dev/null 2>&1; then
echo "git用户组已存在"
else
echo "创建git用户组..."
groupadd git
usermod -aG git git
fi
# 根据定义的裸仓库路径,在指定路径下创建裸仓库
echo "创建裸仓库..."
mkdir -p $GIT_REPO_NAME && cd $GIT_REPO_NAME && git init --bare
# 给上一步创建的裸仓库给予git用户组里git用户读写执行权限
echo "给裸仓库设置权限..."
chown git:git * -R
cd -
chown git:git "$GIT_REPO_NAME"
# 切换到当前脚本所在的目录初始化git仓库并且关联之前创建的本地裸仓库地址。
cd "$(dirname "$0")"
if [ -d ".git" ]; then
echo "该目录是一个Git仓库"
else
echo "该目录不是一个Git仓库"
echo "初始化git仓库..."
git init
fi
echo "关联仓库"
git remote add origin $GIT_REPO_NAME
# 输出这个裸仓库的本地链接地址和远程连接地址
echo "远程仓库关联git remote add production ssh://git@ip:$GIT_REPO_NAME"

@ -18,6 +18,8 @@ return new class extends Migration
$table->dateTime('update_date')->nullable()->comment('更新日期');
// 管理平台
$table->json('project_users')->nullable()->comment('管理平台');
// 股东信息
$table->json('partners')->nullable()->comment('股东信息');
});
}

Loading…
Cancel
Save