配置database.php后怎么使用DB?
<?php namespace App;
use Illuminate\Database\Eloquent\Model;
class Orders extends Model {
public static function getOrders($begin, $end){
$orders = DB::select('select * from t_order where orderTime>? and orderTime<?', [$begin, $end]);
return $orders;
}
}
moduel里这样写的,报错Class 'App\DB' not found,是什么地方没配对吗?
use Illuminate\Database\Eloquent\Model;
class Orders extends Model {
public static function getOrders($begin, $end){
$orders = DB::select('select * from t_order where orderTime>? and orderTime<?', [$begin, $end]);
return $orders;
}
}
moduel里这样写的,报错Class 'App\DB' not found,是什么地方没配对吗?
2 个回复
liuweiyu
赞同来自: FiveSay 、elick
Usual
赞同来自: