我有一種情況,CourseSession屬於Course,屬於Program。在我的控制器中,我想從CourseSession中獲取程序的名稱。我一直在環顧四周,並看到很多人建議使用joins方法。不幸的是,對我來說,這並不適用於我的情況。我得到這個錯誤: Can't join 'CourseSession' to association named 'program'; perhaps you
我是yii2(和yii)開發的新手。我有一個查詢返回客戶的姓名和姓氏以及其他列。我正在使用activeDataProvider來顯示錶中的記錄,但我需要名稱和姓氏顯示在一個表列中。 我想知道的是: 1. how do I concatenate the columns in yii2 activerecord?
2. How do I display the columns in one tab
我不知道爲什麼這個協會是無效 class Tag < ActiveRecord::Base
has_and_belongs_to_many :routes
end
class Route < ActiveRecord::Base
belongs_to :super_route
has_and_belongs_to_many :tags
end
class SuperRou