Laravel:无法从控制器内的users表中获取hasOne外键数据

时间:2017-07-28 07:58:15

标签: php mysql laravel charts eloquent

我想使用控制器内部的DB :: table查询从外键中检索数据,但是我收到的错误是:此集合实例上不存在属性[assigned_to]。我已经做了一对多的用户和表之间的反向关系。

Sub Vlook()
 Dim LR As Long
 Dim Rg2, L As Range
    Rg2 = Workbooks("mis").Sheets(1).Range("A2:Z10000")
 ThisWorkbook.Sheets(1).Activate
            With ActiveSheet
                ActiveSheet.Range("a1").Select
                LR = ActiveSheet.Range("A" & Rows.Count).End(xlUp).Row - 1
                .Columns("A:A").EntireColumn.NumberFormat = "0"
                .Range("a1").Select
                Range("a1").End(xlToRight).Select
                Set L = ActiveSheet.Range("A2")
                With ActiveCell
                .Offset(1, 1).Resize(LR).FormulaR1C1 = "= vlookup( " & L.Address(False, False) & "," & Rg2.Address(True, True, xlR1C1, xlExternal) & ",16,False)"
              End With
              End With

 End Sub

This is my desired results

this is migrations table

0 个答案:

没有答案