我收到以下错误:
警告 (2):array_keys() 期望参数 1 为数组,给定 null [CORE\Cake\Model\Datasource\DboSource.php,第 2181 行]
警告 (2):array_filter() 期望参数 1 为数组,给定 null [CORE\Cake\Model\Datasource\DboSource.php,第 2185 行]
警告 (2):array_values() 期望参数 1 为数组,给定 null [CORE\Cake\Model\Datasource\DboSource.php,第 2185 行]
警告 (2):array_unique() 期望参数 1 为数组,给定 null [CORE\Cake\Model\Datasource\DboSource.php,第 2264 行]
警告 (2):array_merge() [function.array-merge]:参数 #2 不是数组 [CORE\Cake\Model\Datasource\DboSource.php,第 1524 行]
运行时:
public function pdf($the_id) {
$searchs = $this->Order->find('all', array('conditions' => array('Order.id' => $the_id, 'Order.user_id' => $this->userDetails['id'])));
if(empty($searchs)){
$this->Session->setFlash('The requested order was not found or is not your order', 'error');
$this->redirect(array('action' => 'yourorders'));
}
$this->set('orderpdf', $searchs);
}
有谁知道为什么?
编辑----这是模型;这是一个新模型,所以它很小:
class Order extends AppModel {
public $name = 'Order';
public $belongsTo = array('User');
public $hasOne = array('Basket', 'Sage');
}