陈江南
试试
public function actionIndex(){ $student = Student::model()->findAll(); usort($student,'sortByCreateTime'); $sortByCreateTime = function($a, $b){...}; }
$user = User::model()->findAll(array('limit' => 10)); usort($user, 'sortByCreateTime'); $sortByCreateTime = function ($a, $b) { return $a->create_time > $b->create_time ? 1 : -1; };
usort() expects parameter 2 to be a valid callback, function 'sortByCreateTime' not found or invalid function name
还是报这个错误- 陈江南 提出了问题怎么在框架中使用usort函数
- 陈江南 2015-06-19 已签到连续签到20天,获得了20个金钱
- 陈江南 2015-06-18 已签到连续签到19天,获得了20个金钱
- 陈江南 2015-06-17 已签到连续签到18天,获得了20个金钱
- 陈江南 2015-06-16 已签到连续签到17天,获得了20个金钱
- 陈江南 2015-06-15 已签到连续签到16天,获得了20个金钱