后臺添加會員權益報錯問題
問題修復:
修改文件:app\services\user\member\MemberRightServices
添加方法:
/**
* 添加權益內容
* @param int $id
* @param array $data
* @return bool
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function save_content(int $id, array $data)
{
if (!$id) throw new AdminException("id參數缺失");
if (!$data['content']) throw new AdminException("請添加權益內容");
$this->dao->update($id, $data);
$right = $this->dao->get($id);
if ($right) {
$this->dao->cacheUpdate($right->toArray());
}
return true;
}
或者下載下面文件覆蓋