当我选择1个条目时,它将成功删除,但是当我选择2个Enteries时,它将引发错误“您没有权限...” 这是功能代码:
protected function processBulkDelete()
{
if ($this->tabAccess['delete'] === '1') {
$success = 1;
if (is_array($this->boxes) && !empty($this->boxes)) {
$uploaded_data = Tools::getValue($this->table.'Box');
$csv_path = dirname(__FILE__).'/../../views/uploaded_csv/';
foreach($uploaded_data as $upload_id){
$upload_obj = new MarketplaceMassUpload($upload_id);
$request_no = $upload_obj->request_id;
unlink($csv_path.$request_no.".csv");
$success &= $upload_obj->delete();
}
Tools::redirectAdmin(self::$currentIndex.'&conf=2&token='. $this->token);
}
else
$this->errors[] = Tools::displayError('You must select at least one element to delete.');
}
else
$this->errors[] = Tools::displayError('You do not have permission to delete this.');
}
答案 0 :(得分:0)
$ this-> tabAccess ['delete']的值是什么? (您可以使用var_dump($ this-> tabAccess ['delete']))查看值是什么。
您能详细告诉我什么是tabAccess函数吗?该功能可能有问题
致谢