1
为什么会按预期返回集合;Laravel无法正常工作
$postcodes = DB::table('payments')->whereIn('VendorZIP', array('BS19AA','PO48AA'))->get();
print_r($postcodes);
但是,这会返回一个错误;
$payments = Payment::all();
$payments->whereIn('VendorZIP', array('BS19AA','PO48AA'))->get();
print_r($payments);
错误是;
Call to undefined method Illuminate\Database\Eloquent\Collection::whereIn()
当然,我有一个付款模式;
<?php namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Payment extends Model {
//
}