/** * @return \yii\db\ActiveQuery */ public function getDepartments() { return $this->hasMany(Departments::className(), ['companies_company_id' => 'company_id']); }
public function getDepart() { return $this->hasOne(Departments::className(), ['id' => 'department_id']); }
public function getDeptool() { // ความสัมพันธ์จาก tools ไปหา departments return $this->hasOne(Departments::className(), ['id' => 'department_id']); }
public function getDepartments() { return $this->hasOne(Departments::className(), ['id' => 'iddepartment'])->viaTable(Expenses::tableName(), ['id' => 'idexpense']); }
/** * @return \yii\db\ActiveQuery */ public function getDepartments() { return $this->hasMany(Departments::className(), ['branches_branch_id' => 'branch_id']); }