$params['custom_id'] ?? 0, 'contacts' => $params['contacts'] ?? '', 'date' => strtotime($params['date']), 'types' => $params['types'] ?? 0, 'admin_id' => $params['admin_id'] ?? 0, 'description' => $params['description'] ?? '', 'annex' => $params['annex'] ?? '', 'coordinate' => $params['coordinate'] ?? 0, 'next_follow_date' => strtotime($params['next_follow_date']), 'status' => $params['status'] ?? 0 ]); Db::commit(); return true; } catch (\Exception $e) { Db::rollback(); self::setError($e->getMessage()); return false; } } /** * @notes 编辑 * @param array $params * @return bool * @author likeadmin * @date 2023/11/12 13:40 */ public static function edit(array $params): bool { Db::startTrans(); try { CustomFollow::where('id', $params['id'])->update([ 'custom_id' => $params['custom_id'] ?? 0, 'contacts' => $params['contacts'] ?? '', 'date' => strtotime($params['date']), 'types' => $params['types'] ?? 0, 'admin_id' => $params['admin_id'] ?? 0, 'description' => $params['description'] ?? '', 'annex' => $params['annex'] ?? '', 'coordinate' => $params['coordinate'] ?? 0, 'next_follow_date' => strtotime($params['next_follow_date']), 'status' => $params['status'] ?? 0 ]); Db::commit(); return true; } catch (\Exception $e) { Db::rollback(); self::setError($e->getMessage()); return false; } } /** * @notes 删除 * @param array $params * @return bool * @author likeadmin * @date 2023/11/12 13:40 */ public static function delete(array $params): bool { return CustomFollow::destroy($params['id']); } /** * @notes 获取详情 * @param $params * @return array * @author likeadmin * @date 2023/11/12 13:40 */ public static function detail($params): array { $customFollow = CustomFollow::findOrEmpty($params['id']); $customFollow->custom; return $customFollow->toArray(); } }