jjzjj

getTable

全部标签

php - 无法在类 App\bill、Laravel 中使非静态方法 Illuminate\Database\Eloquent\Model::getTable() 静态化

我在模型中创建了如下方法:classbillextendsModel{publicstaticfunctiongetTable(){$tables=Bill::where('order_type','0')->where('table_no','','')->groupBy('table_no')->get();return$tables;}}在Controller中我访问这个方法是publicfunctionbill(){$data=Bill::getTable();returnview('bill.bills');}它给出错误,因为Cannotmakenonstaticmethod

php - Doctrine_Core::getTable()->findAll() 如何指定顺序?

当使用Doctrine_Table对象时,是否可以在使用findAll()或findByWhatever()时指定返回集合的顺序?在doc's我看到了一些关于getOrderByStatement()和processOrderBy()的东西,但不清楚如何使用它们... 最佳答案 也可以将第一个数组留空$em->getRepository('BackendDestinyBundle:Destiny')->findBy(array(),array('title'=>'asc')); 关于ph