$params['project_commission_id'], 'engineer' => $params['engineer'], 'engineer_id' => $params['engineer_id'], 'task_name' => $params['task_name'], 'task_type' => $params['task_type'], 'professional_type' => $params['professional_type'], 'zj_amount' => $params['zj_amount'], 'sk_amount' => $params['sk_amount'], 'tc_rate' => $params['tc_rate'], 'tc_amount' => $params['tc_amount'], 'pay_amount' => $params['pay_amount'], 'remark' => $params['remark'], 'other_fee' => $params['other_fee'], ]); Db::commit(); return true; } catch (\Exception $e) { Db::rollback(); self::setError($e->getMessage()); return false; } } /** * @notes 编辑 * @param array $params * @return bool * @author likeadmin * @date 2024/02/23 09:48 */ public static function edit(array $params): bool { Db::startTrans(); try { ProjectCommissionDetail::where('id', $params['id'])->update([ 'engineer' => $params['engineer'], 'engineer_id' => $params['engineer_id'], 'task_name' => $params['task_name'], 'task_type' => $params['task_type'], 'professional_type' => $params['professional_type'], 'zj_amount' => $params['zj_amount'], 'sk_amount' => $params['sk_amount'], 'tc_rate' => $params['tc_rate'], 'tc_amount' => $params['tc_amount'], 'pay_amount' => $params['pay_amount'], 'remark' => $params['remark'], 'other_fee' => $params['other_fee'], ]); Db::commit(); return true; } catch (\Exception $e) { Db::rollback(); self::setError($e->getMessage()); return false; } } /** * @notes 删除 * @param array $params * @return bool * @author likeadmin * @date 2024/02/23 09:48 */ public static function delete(array $params): bool { return ProjectCommissionDetail::destroy($params['id']); } /** * @notes 获取详情 * @param $params * @return array * @author likeadmin * @date 2024/02/23 09:48 */ public static function detail($params): array { return ProjectCommissionDetail::findOrEmpty($params['id'])->toArray(); } }