$params['title'], 'content' => $params['content'], 'sort' => $params['sort'] ?? 1, ]); } /** * @notes 编辑客服话术 * @param array $params * @return KefuLang * @author 段誉 * @date 2022/3/9 14:35 */ public static function edit(array $params) { return KefuLang::update([ 'id' => $params['id'], 'title' => $params['title'], 'content' => $params['content'], 'sort' => $params['sort'], ]); } /** * @notes 删除客服话术 * @param int $id * @return bool * @author 段誉 * @date 2022/3/9 14:36 */ public static function del(int $id): bool { return KefuLang::destroy($id); } /** * @notes 获取客服话术详情 * @param int $id * @return array * @author 段誉 * @date 2022/3/9 14:37 */ public static function detail(int $id) { return KefuLang::findOrEmpty($id)->toArray(); } }