等价于$ DB-> Select(“ Raw expression here”)的数组

时间:2019-02-08 09:46:22

标签: laravel eloquent

我在做

$DB->select(
  "SELECT i::DATE
   FROM generate_series('2019-01-01', '2019-01-05', '1 day'::INTERVAL) i
  ")

它返回就像

[{i : '2019-01-01'},
{i : '2019-01-02'},
{i : '2019-01-03'},
{i : '2019-01-04'},
{i : '2019-01-05'}]

靠它可以,但是如何使它形成像这样

['2019-01-01', '2019-01-02', '2019-01-03', '2019-01-04', '2019-01-05']

如果是这样

$DB->table("my table")->where("some condition")->get()

我可以像这样继续

->pluck("my desired column (which is i)")->toArray()

0 个答案:

没有答案