$params['approve_id'] ?? 0, 'bidding_decision_id' => $params['bidding_decision_id'] ?? 0, 'applier' => $params['applier'] ?? '', 'pay_type' => $params['pay_type'] ?? 0, 'refund_date' => $params['refund_date'] ?? '', 'remark' => $params['remark'] ?? '', 'annex' => $params['annex'] ?? '', 'deposit_bank' => $params['deposit_bank'] ?? '', 'account_name' => $params['account_name'] ?? '', 'account' => $params['account'] ?? '', ]); 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/12/16 10:46 */ public static function edit(array $params): bool { Db::startTrans(); try { BidSecurityApply::where('id', $params['id'])->update([ 'approve_id' => $params['approve_id'] ?? 0, 'bidding_decision_id' => $params['bidding_decision_id'] ?? 0, 'applier' => $params['applier'] ?? '', 'pay_type' => $params['pay_type'] ?? 0, 'refund_date' => $params['refund_date'] ?? '', 'remark' => $params['remark'] ?? '', 'annex' => $params['annex'] ?? '', 'deposit_bank' => $params['deposit_bank'] ?? '', 'account_name' => $params['account_name'] ?? '', 'account' => $params['account'] ?? '', ]); 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/12/16 10:46 */ public static function delete(array $params): bool { return BidSecurityApply::destroy($params['id']); } /** * @notes 获取详情 * @param $params * @return array * @author likeadmin * @date 2023/12/16 10:46 */ public static function detail($params): array { $bidSecurityApply = BidSecurityApply::findOrEmpty($params['id']); $bidSecurityApply->project = null; $bidSecurityApply->custom = null; if (!empty($bidSecurityApply->decision->project_id)) { $bidSecurityApply->project = Project::findOrEmpty($bidSecurityApply->decision->project_id); } if (!empty($bidSecurityApply->project->custom_id)) { $bidSecurityApply->custom = Custom::findOrEmpty($bidSecurityApply->project->custom_id); } return $bidSecurityApply->toArray(); } }