【发布时间】:2016-10-23 07:53:34
【问题描述】:
我不明白如何在同一个类中访问表名。
class Timesheets extends Model
{
protected $table = "timesheets";
public static function getAllTimesheets() {
//return DB::table("timesheets")->get();
return DB::table("timesheets")
->join('users', 'name', '=', 'users.name')
->select('timesheets.id', 'name', 'timesheets.time_start', 'timesheets.time_end', 'timesheets.time_desc')
->get();
}
}
如何将“时间表”替换为受保护的 Table 变量?
【问题讨论】:
标签: php class laravel protected