'ID', 'goods_id' => 'Goods ID', 'store_id' => 'Store ID', 'cat_id' => '分类id 多个分类用英文逗号隔开', 'addtime' => 'Addtime', 'is_delete' => 'Is Delete', ]; } // 关联商品表 public function getGoods() { return $this->hasOne(Goods::className(), ['id'=>'goods_id']); } public function getCat() { return $this->hasOne(Cat::className(), ['id' => 'cat_id']); } public function afterSave($insert, $changedAttributes) { $data = $insert ? json_encode($this->attributes) : json_encode($changedAttributes); CommonActionLog::storeActionLog('', $insert, $this->is_delete, $data, $this->id); } }