diff --git a/app/Console/Commands/UpdateCompany.php b/app/Console/Commands/UpdateCompany.php index 0c673c6..672a05b 100755 --- a/app/Console/Commands/UpdateCompany.php +++ b/app/Console/Commands/UpdateCompany.php @@ -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); // 更新用户关联 diff --git a/app/Models/Company.php b/app/Models/Company.php index 8da3a96..6c95159 100644 --- a/app/Models/Company.php +++ b/app/Models/Company.php @@ -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'); diff --git a/bare.sh b/bare.sh deleted file mode 100755 index b294733..0000000 --- a/bare.sh +++ /dev/null @@ -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" diff --git a/database/migrations/2025_11_11_140323_alert_companies_table.php b/database/migrations/2025_11_11_140323_alert_companies_table.php index 3d86c1f..88ad941 100644 --- a/database/migrations/2025_11_11_140323_alert_companies_table.php +++ b/database/migrations/2025_11_11_140323_alert_companies_table.php @@ -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('股东信息'); }); }