$params['customer_id'], 'quotation_date' => $params['quotation_date'], 'contacts' => $params['contacts'], 'contacts_phone' => $params['contacts_phone'], 'create_user' => $params['create_user'], 'invoice_type' => $params['invoice_type'], 'amount_including_tax' => $params['amount_including_tax'], 'freight' => $params['freight'], 'other_fee' => $params['other_fee'], 'total_amount' => $params['total_amount'], 'customer_require' => $params['customer_require'], 'remark' => $params['remark'], 'annex' => $params['annex'] ]); 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/27 17:23 */ public static function edit(array $params): bool { Db::startTrans(); try { Quotation::where('id', $params['id'])->update([ 'customer_id' => $params['customer_id'], 'quotation_date' => $params['quotation_date'], 'contacts' => $params['contacts'], 'contacts_phone' => $params['contacts_phone'], 'create_user' => $params['create_user'], 'invoice_type' => $params['invoice_type'], 'amount_including_tax' => $params['amount_including_tax'], 'freight' => $params['freight'], 'other_fee' => $params['other_fee'], 'total_amount' => $params['total_amount'], 'customer_require' => $params['customer_require'], 'remark' => $params['remark'], 'annex' => $params['annex'] ]); 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/27 17:23 */ public static function delete(array $params): bool { return Quotation::destroy($params['id']); } /** * @notes 获取报价单详情 * @param $params * @return array * @author likeadmin * @date 2023/11/27 17:23 */ public static function detail($params): array { return Quotation::findOrEmpty($params['id'])->toArray(); } }