萤火php端: 查询数据的时候报错: “message“: “Undefined index: pay_status“,

代码:getGoodsFromHistory  

<?php
// +----------------------------------------------------------------------
// | 萤火商城系统 [ 致力于通过产品和服务,帮助商家高效化开拓市场 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2024 https://www.yiovo.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
// +----------------------------------------------------------------------
// | Author: 萤火科技 <admin@yiovo.com>
// +----------------------------------------------------------------------
declare (strict_types=1);namespace app\api\service;use app\api\model\Order as OrderModel;
use app\api\model\order\Delivery as DeliveryModel;
use app\api\model\OrderAddress as OrderAddressModel;
use app\api\service\User as UserService;
use app\common\service\Order as OrderService;
use app\common\service\Express as ExpressService;
use app\common\enum\order\OrderStatus as OrderStatusEnum;
use cores\exception\BaseException;/*** 订单服务类* Class Order* @package app\common\service*/
class Order extends OrderService
{/*** 获取物流信息* @param int $orderId 订单ID* @return mixed* @throws BaseException* @throws \think\db\exception\DataNotFoundException* @throws \think\db\exception\DbException* @throws \think\db\exception\ModelNotFoundException*/public function express(int $orderId){// 获取发货单列表$model = new DeliveryModel;$list = $model->getList($orderId);// 整理物流跟踪信息return $this->getExpressTraces($orderId, $list);}/*** 整理物流跟踪信息* @param int $orderId 订单ID* @param $list* @return mixed* @throws BaseException* @throws \think\db\exception\DataNotFoundException* @throws \think\db\exception\DbException* @throws \think\db\exception\ModelNotFoundException*/private function getExpressTraces(int $orderId, $list){// 订单收货地址$address = OrderAddressModel::detail(['order_id' => $orderId]);// 整理物流跟踪信息$Express = new ExpressService;foreach ($list as $item) {if (!empty($item['express'])) {$item['traces'] = $Express->traces($item['express'],$item['express_no'],$address,$this->getStoreId());}}return $list;}/*** 获取某商品的购买件数* @param int $userId 用户ID* @param int $goodsId 商品ID* @param int $orderSource* @return int*/public static function getGoodsBuyNum(int $userId, int $goodsId, int $orderSource): int{return (int) (new OrderModel)->setBaseQuery('order', [['order_goods', 'order_id']])->where('order_goods.user_id', '=', $userId)->where('order_goods.goods_id', '=', $goodsId)->where('order.order_source', '=', $orderSource)->where('order.order_status', '<>', OrderStatusEnum::CANCELLED)->where('order.is_delete', '=', 0)->sum('order_goods.total_num');}/*** 根据用户id 来判断是否是新用户* @return \app\api\model\Goods[]|array|\think\Collection* @throws \cores\exception\BaseException* @throws \think\db\exception\DataNotFoundException* @throws \think\db\exception\DbException* @throws \think\db\exception\ModelNotFoundException*/public function getGoodsList(){// 当前用户ID$userId = UserService::getCurrentLoginUserId();// 查询列表记录return (new orderModel)->where('user_id', '=', $userId)->where('is_delete', '=', 0)->select();}public function getGoodsFromHistory(){$userId = UserService::getCurrentLoginUserId();return (new OrderModel())->alias('a')->join('order_goods b', 'a.order_id = b.order_id')->where('a.user_id', '=', $userId)->where('a.is_delete', '=', 0)//->field('b.goods_id,a.order_status')->field('b.goods_id,a.order_status,a.pay_status,a.delivery_status,a.receipt_status') // 选择商品ID和购买总数->select()->toArray();}}

表结构:

CREATE TABLE `yoshop_order` (`order_id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '订单ID',`order_no` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '订单号',`order_type` tinyint(3) unsigned NOT NULL DEFAULT '10' COMMENT '订单类型(10实物订单)',`total_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '商品总金额(不含优惠折扣)',`order_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '订单金额(含优惠折扣)',`coupon_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '优惠券ID',`coupon_money` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '优惠券抵扣金额',`points_money` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '积分抵扣金额',`points_num` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '积分抵扣数量',`pay_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '实际付款金额(包含运费)',`update_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '后台修改的订单金额(差价)',`buyer_remark` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '买家留言',`pay_method` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '支付方式(余额/微信/支付宝)',`pay_status` tinyint(3) unsigned NOT NULL DEFAULT '10' COMMENT '付款状态(10未付款 20已付款)',`pay_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '付款时间',`trade_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '第三方交易记录ID',`delivery_type` tinyint(3) unsigned NOT NULL DEFAULT '10' COMMENT '配送方式(10快递配送 20门店自提 30无需配送)',`express_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '运费金额',`delivery_status` tinyint(3) unsigned NOT NULL DEFAULT '10' COMMENT '发货状态(10未发货 20已发货 30部分发货)',`delivery_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '发货时间',`receipt_status` tinyint(3) unsigned NOT NULL DEFAULT '10' COMMENT '收货状态(10未收货 20已收货)',`receipt_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '收货时间',`order_status` tinyint(3) unsigned NOT NULL DEFAULT '10' COMMENT '订单状态(10进行中 20取消 21待取消 30已完成)',`points_bonus` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '赠送的积分数量',`merchant_remark` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '商家备注',`is_settled` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '订单是否已结算(0未结算 1已结算)',`settled_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '订单结算时间',`is_comment` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '是否已评价(0否 1是)',`order_source` tinyint(3) unsigned NOT NULL DEFAULT '10' COMMENT '订单来源(10普通订单 20砍价订单 30秒杀订单)',`order_source_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '来源记录ID',`order_source_data` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '来源记录的参数 (json格式)',`platform` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '来源客户端 (APP、H5、小程序等)',`user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户ID',`is_delete` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '是否删除',`store_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商城ID',`create_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',`update_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',PRIMARY KEY (`order_id`),UNIQUE KEY `order_no` (`order_no`),KEY `store_id` (`store_id`),KEY `user_id` (`user_id`),KEY `pay_status` (`pay_status`),KEY `delivery_status` (`delivery_status`),KEY `receipt_status` (`receipt_status`),KEY `order_status` (`order_status`),KEY `is_settled` (`is_settled`),KEY `order_source` (`order_source`)
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='订单记录表';CREATE TABLE `yoshop_order_goods` (`order_goods_id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '订单商品ID',`goods_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商品ID',`goods_type` tinyint(3) unsigned NOT NULL DEFAULT '10' COMMENT '商品类型(10实物商品)',`goods_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '商品名称',`image_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商品封面图ID',`deduct_stock_type` tinyint(3) unsigned NOT NULL DEFAULT '20' COMMENT '库存计算方式(10下单减库存 20付款减库存)',`spec_type` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '规格类型(10单规格 20多规格)',`goods_sku_id` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '商品sku唯一标识',`goods_props` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'SKU的规格属性(json格式)',`content` longtext COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '商品详情',`goods_no` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '商品编码',`goods_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '商品价格(单价)',`line_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '商品划线价',`goods_weight` double unsigned NOT NULL DEFAULT '0' COMMENT '商品重量(Kg)',`is_user_grade` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '是否存在会员等级折扣',`grade_ratio` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '会员折扣比例(0-10)',`grade_goods_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '会员折扣的商品单价',`grade_total_money` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '会员折扣的总额差',`coupon_money` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '优惠券折扣金额',`points_money` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '积分金额',`points_num` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '积分抵扣数量',`points_bonus` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '赠送的积分数量',`total_num` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '购买数量',`total_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '商品总价(数量×单价)',`total_pay_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '实际付款价(折扣和优惠后)',`delivery_status` tinyint(3) unsigned NOT NULL DEFAULT '10' COMMENT '发货状态(10未发货 20已发货 30部分发货)',`delivery_num` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '已发货数量',`is_comment` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '是否已评价(0否 1是)',`order_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '订单ID',`user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户ID',`goods_source_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '来源记录ID',`store_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商城ID',`create_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',PRIMARY KEY (`order_goods_id`),KEY `goods_id` (`goods_id`),KEY `order_id` (`order_id`),KEY `user_id` (`user_id`),KEY `store_id` (`store_id`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='订单商品记录表';

我只想查到用户下单的商品的id 。  然后filed 中只写了  goods_id  报错如上。 

然后发现在Order 模型中有一个将 订单的付款状态返回成  0-》 未支付 的函数 ,因为我查询出来的数据没有这个字段所以报错。  加上所需要的字段就正常了

Order 模型代码:getStateTextAttr

<?php
// +----------------------------------------------------------------------
// | 萤火商城系统 [ 致力于通过产品和服务,帮助商家高效化开拓市场 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2024 https://www.yiovo.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
// +----------------------------------------------------------------------
// | Author: 萤火科技 <admin@yiovo.com>
// +----------------------------------------------------------------------
declare (strict_types=1);namespace app\common\model;use app\api\model\Order as OrderModel;
use app\api\service\User as UserService;
use cores\BaseModel;
use app\common\service\Order as OrderService;
use app\common\enum\order\PayStatus as PayStatusEnum;
use app\common\enum\order\OrderStatus as OrderStatusEnum;
use app\common\enum\order\ReceiptStatus as ReceiptStatusEnum;
use app\common\enum\order\DeliveryStatus as DeliveryStatusEnum;
use app\common\library\helper;
use think\db\exception\DataNotFoundException;
use think\db\exception\DbException;
use think\db\exception\ModelNotFoundException;
use think\model\relation\HasOne;
use think\model\relation\HasMany;
use think\model\relation\BelongsTo;/*** 订单模型* Class Order* @package app\common\model*/
class Order extends BaseModel
{// 定义表名protected $name = 'order';// 定义表名(外部引用)public static string $tableName = 'order';// 定义主键protected $pk = 'order_id';// 定义别名protected string $alias = 'order';/*** 追加字段* @var array*/protected $append = ['state_text',   // 售后单状态文字描述];/*** 订单商品列表* @return HasMany*/public function goods(): HasMany{$module = self::getCalledModule();return $this->hasMany("app\\{$module}\\model\\OrderGoods")->withoutField('content');}/*** 关联订单发货单* @return hasMany*/public function delivery(): HasMany{$module = self::getCalledModule();return $this->hasMany("app\\{$module}\\model\\order\\Delivery");}/*** 关联订单收货地址表* @return HasOne*/public function address(): HasOne{$module = self::getCalledModule();return $this->hasOne("app\\{$module}\\model\\OrderAddress");}/*** 关联用户表* @return BelongsTo*/public function user(): BelongsTo{$module = self::getCalledModule();return $this->belongsTo("app\\{$module}\\model\\User");}/*** 关联物流公司表 (仅用于兼容旧物流数据)* @return BelongsTo*/public function express(): BelongsTo{$module = self::getCalledModule();return $this->belongsTo("app\\{$module}\\model\\Express");}/*** 关联模型:第三方交易记录* @return BelongsTo*/public function trade(): BelongsTo{$module = self::getCalledModule();return $this->belongsTo("app\\{$module}\\model\\PaymentTrade", 'trade_id', 'trade_id');}/*** 获取器:订单状态文字描述* @param $value* @param $data* @return string*/public function getStateTextAttr($value, $data): string{//todo  这种设置了TextAttr 的查询的时候会加上这个// 订单状态if ($data['order_status'] != OrderStatusEnum::NORMAL) {return OrderStatusEnum::data()[$data['order_status']]['name'];}// 付款状态if ($data['pay_status'] == PayStatusEnum::PENDING) {return '待支付';}// 发货状态if ($data['delivery_status'] != DeliveryStatusEnum::DELIVERED) {$enum = [DeliveryStatusEnum::NOT_DELIVERED => '待发货', DeliveryStatusEnum::PART_DELIVERED => '部分发货'];return $enum[$data['delivery_status']];}// 收货状态if ($data['receipt_status'] == ReceiptStatusEnum::NOT_RECEIVED) {return '待收货';}return $value;}/*** 获取器:订单金额(含优惠折扣)* @param $value* @param $data* @return string*/public function getOrderPriceAttr($value, $data): string{// 兼容旧数据:订单金额if ($value == 0) {return helper::bcadd(helper::bcsub($data['total_price'], $data['coupon_money']), $data['update_price']);}return $value;}/*** 获取器:改价金额(差价)* @param $value* @return array*/public function getUpdatePriceAttr($value): array{return ['symbol' => $value < 0 ? '-' : '+','value' => sprintf('%.2f', abs((float)$value))];}/*** 获取器:付款时间* @param $value* @return false|string*/public function getPayTimeAttr($value){return format_time($value);}/*** 获取器:发货时间* @param $value* @return false|string*/public function getDeliveryTimeAttr($value){return format_time($value);}/*** 获取器:收货时间* @param $value* @return false|string*/public function getReceiptTimeAttr($value){return format_time($value);}/*** 获取器:来源记录的参数* @param $json* @return array*/public function getOrderSourceDataAttr($json): array{return $json ? helper::jsonDecode($json) : [];}/*** 修改器:来源记录的参数* @param array $data* @return string*/public function setOrderSourceDataAttr(array $data): string{return helper::jsonEncode($data);}/*** 生成订单号* @return string*/public function orderNo(): string{return OrderService::createOrderNo();}/*** 订单详情* @param $where* @param array $with* @return static|array|null*/public static function detail($where, array $with = []){is_array($where) ? $filter = $where : $filter['order_id'] = (int)$where;return self::get($filter, $with);}/*** 批量获取订单列表* @param array $orderIds* @param array $with* @return array* @throws DataNotFoundException* @throws DbException* @throws ModelNotFoundException*/public function getListByIds(array $orderIds, array $with = []): array{$data = $this->getListByInArray('order_id', $orderIds, $with);return helper::arrayColumn2Key($data, 'order_id');}/*** 批量获取订单列表* @param $field* @param $data* @param array $with* @return \think\Collection* @throws \think\db\exception\DataNotFoundException* @throws \think\db\exception\DbException* @throws \think\db\exception\ModelNotFoundException*/private function getListByInArray($field, $data, array $with = []): \think\Collection{return $this->with($with)->where($field, 'in', $data)->where('is_delete', '=', 0)->select();}/*** 根据订单号批量查询* @param $orderNos* @param array $with* @return \think\Collection* @throws \think\db\exception\DataNotFoundException* @throws \think\db\exception\DbException* @throws \think\db\exception\ModelNotFoundException*/public function getListByOrderNos($orderNos, array $with = []): \think\Collection{return $this->getListByInArray('order_no', $orderNos, $with);}/*** 批量更新订单* @param $orderIds* @param $data* @return bool|false*/public function onBatchUpdate($orderIds, $data): bool{return static::updateBase($data, [['order_id', 'in', $orderIds]]);}
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/440274.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

自建RustDesk服务器:详细步骤与操作指南

在远程办公和协作日益普及的今天&#xff0c;远程桌面软件成为了不可或缺的工具。然而&#xff0c;许多知名的远程桌面软件&#xff0c;在免费使用一段时间后&#xff0c;会通过限制连接数量、时长或在特定网络环境下的可用性来促使用户付费升级&#xff0c;而且其会员非常昂贵…

【stm32】ADC的介绍与使用

ADC的介绍与使用 1、ADC介绍2、逐次逼近型ADC3、ADC电路4、ADC基本结构程序代码编写&#xff1a;ADC 通道和引脚复用的关系 5、转换模式&#xff08;1&#xff09;单次转换&#xff0c;非扫描模式转换流程&#xff1a;程序编写&#xff1a; &#xff08;2&#xff09;连续转换&…

详细分析Spring Security OAuth2中的JwtAccessTokenConverter基本知识(附Demo)

目录 前言1. 基本知识2. Demo3. 实战 前言 java框架 零基础从入门到精通的学习路线 附开源项目面经等&#xff08;超全&#xff09;【Java项目】实战CRUD的功能整理&#xff08;持续更新&#xff09; 1. 基本知识 JwtAccessTokenConverter 是 Spring Security OAuth2 中的一…

一、Python(介绍、环境搭建)

一、介绍 Python 是一种高级编程语言&#xff0c;具有简洁易读的语法、丰富的库和强大的功能。Python是解释型语言&#xff0c;运行代码必须依赖安装好的解释器。Python目前存在两个版本&#xff1a;Python2、Python3&#xff08;主流使用&#xff09; 二、环境搭建 1.安装P…

<<迷雾>> 第8章 学生时代的走马灯(3)--走马灯 示例电路

几个首尾相连的触发器使用同一个控制端&#xff0c;能同时触发 info::操作说明 鼠标单击开关切换开合状态 注: 其中 CP 为按钮开关, 每点击一次, Q 的输出前进一级 注: 第一个触发器的输出端 Q 需要先置入高电平. 如果重置了电路, 可外接电源先使第一个 Q 置入高电平. 另: 因为…

深度学习:5种经典神经网络模型介绍

目录 1. LeNet&#xff1a;CNN的鼻祖 2. AlexNet&#xff1a;深度学习的开山之作 3. VGGNet&#xff1a;深度与简洁的结合 4. GoogLeNet&#xff1a;Inception模块的创新 5. ResNet&#xff1a;残差学习的革命 卷积神经网络&#xff08;CNN&#xff09;已经发展为图像识别…

棋牌灯控计时计费系统软件免费试用版怎么下载 佳易王计时收银管理系统操作教程

一、前言 【试用版软件下载&#xff0c;可以点击本文章最下方官网卡片】 棋牌灯控计时计费系统软件免费试用版怎么下载 佳易王计时收银管理系统操作教程 棋牌计时计费软件的应用也提升了顾客的服务体验&#xff0c;顾客可以清晰的看到自己的消费时间和费用。增加了消费的透明…

梯度下降学习

前言&#xff1a;初步学习梯度下降&#xff0c; 不断根据梯度修改我们的参数&#xff0c;经过多次轮次得到使得我们损失函数最小的时候参数&#xff0c;后续我们可以通过类似的道理&#xff0c;更新我们的参数 假设我们的损失函数是 y x 1 2 x 2 2 y x1^2 x2^2 yx12x22,我…

用Python实现运筹学——Day 14: 线性规划总结与案例复习

一、学习内容 在本节中&#xff0c;我们将复习之前所学的线性规划模型与求解方法&#xff0c;并通过一个综合案例将这些知识应用于求解一个多阶段的生产计划问题。 主要复习内容包括&#xff1a; 线性规划的基础概念&#xff1a;目标函数、约束条件、决策变量。求解方法&…

什么是 HTTP 请求中的 preflight 类型请求

在浏览器的 HTTP 请求中&#xff0c;当我们使用 fetch API 或者 XMLHttpRequest 来进行跨域请求时&#xff0c;浏览器有时会发送一种称为 Preflight 的请求。这种请求是浏览器在实际发送跨域请求前&#xff0c;先与目标服务器进行的一次 “探测” 请求&#xff0c;以确认服务器…

组合式API

1.入口&#xff1a;setup setup中的数据和方法必须return出去&#xff0c;模板才能使用 <script> export default {setup () {console.log(setup);const message this is a messageconst logMessage () > {console.log(message);}return {message,logMessage}},be…

Visual Studio 2017编译libexpat源码过程

一、编译环境 操作系统&#xff1a;Windows 10 企业版 64位 编译工具&#xff1a;Visual Studio 2017 构建工具&#xff1a;CMake3.22 源码版本&#xff1a;libexpat-R_2_4_0 二、CMake生成解决方案 解压libexpat源码&#xff0c;然后启动CMake选择libexpat源码目录&#xff1…

数据结构 ——— 单链表oj题:链表的回文结构

目录 题目要求 手搓简易单链表 代码实现 题目要求 对于一个单链表&#xff0c;设计一个时间复杂度为O(N)&#xff0c;空间复杂度为O(1)的算法&#xff0c;判断其是否为回文结构&#xff0c;给定一个链表的头指针 head&#xff0c;返回一个 bool 值&#xff0c;代表其是否为…

从认识String类,到走进String类的世界

作为一个常用的数据类型&#xff0c;跟随小编一同进入String的学习吧&#xff0c;领略String的一些用法。 1. 认识 String 类 2. 了解 String 类的基本用法 3. 熟练掌握 String 类的常见操作 4. 认识字符串常量池 5. 认识 StringBuffer 和 StringBuilder 一&#xff1a;…

Selenium WebDriver和Chrome对照表

PS&#xff1a;我的没下载WebDriver 也没配置环境变量 也能用Selenium 网上有说把WebDriver放到chrome的安装目录并将路径配到path中【可能之前用playwright下载过】 查看浏览器版本号 在浏览器的地址栏&#xff0c;输入chrome://version/&#xff0c;回车后即可查看到对应版…

文心一言 VS 讯飞星火 VS chatgpt (363)-- 算法导论24.3 5题

五、Newman 教授觉得自己发现了 Dijkstra 算法的一个更简单的证明。他声称 Dikstra 算法对最短路径上面的每条边的松弛次序与该条边在该条最短路径中的次序相同&#xff0c;因此&#xff0c;路径松弛性质适用于从源结点可以到达的所有结点。请构造一个有向图来说明 Dijkstra 算…

SpringBoot基础(四):bean的多种加载方式

SpringBoot基础系列文章 SpringBoot基础(一)&#xff1a;快速入门 SpringBoot基础(二)&#xff1a;配置文件详解 SpringBoot基础(三)&#xff1a;Logback日志 SpringBoot基础(四)&#xff1a;bean的多种加载方式 目录 一、xml配置文件二、注解定义bean1、使用AnnotationCon…

逻辑回归(下): Sigmoid 函数的发展历史

背景 闲来无事翻了一下之前买的一个机器学习课程及之前记录的网络笔记&#xff0c;发现遇到公式都是截图&#xff0c;甚至是在纸上用笔推导的。重新整理一遍之前逻辑回归函数的学习笔记&#xff0c;主要是为了玩一下 LaTex 语法&#xff0c;写公式挺有意思的。 整理之前三篇笔…

鸿蒙harmonyos next flutter通信之MethodChannel获取设备信息

本文将通过MethodChannel获取设备信息&#xff0c;以此来演练MethodChannel用法。 建立channel flutter代码&#xff1a; MethodChannel methodChannel MethodChannel("com.xmg.test"); ohos代码&#xff1a; private channel: MethodChannel | null nullthis.c…

使用JavaScript写一个网页端的四则运算器

目录 style(内联样式表部分) body部分 html script 总的代码 网页演示 style(内联样式表部分) <style>body {font-family: Arial, sans-serif;display: flex;justify-content: center;align-items: center;height: 100vh;background-color: #f0f0f0;}.calculator {…