创建版本

This commit is contained in:
2021-02-22 12:17:00 +08:00
commit af555f49c3
2332 changed files with 369202 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
<?php namespace Gdoo\Project\Models;
use Gdoo\Index\Models\BaseModel;
class Task extends BaseModel
{
protected $table = 'project_task';
public function project()
{
return $this->belongsTo('Gdoo\Project\Models\Project');
}
public function users()
{
return $this->belongsToMany('Gdoo\User\Models\User', 'project_task_user', 'task_id', 'user_id');
}
public function syncUsers($gets)
{
$users = $gets[$gets['type'].'_users'];
$users = $users == '' ? [] : explode(',', $users);
$this->users()->sync($users);
}
}