diff --git a/doc/database/upgrade/v1.1.42.sql b/doc/database/upgrade/v1.1.42.sql new file mode 100644 index 0000000..e3604df --- /dev/null +++ b/doc/database/upgrade/v1.1.42.sql @@ -0,0 +1,7 @@ + + +UPDATE `yoshop_store_access` SET `sort`='105' WHERE (`access_id`='10061'); +UPDATE `yoshop_store_access` SET `sort`='110' WHERE (`access_id`='10069'); + +INSERT INTO `yoshop_store_access` VALUES ('11004', '订阅消息', 'wxapp.submsg/index', '10059', '105', '1589158947', '1589158947'); + diff --git a/doc/更新日志.txt b/doc/更新日志.txt index 0f4eb47..9f8261f 100644 --- a/doc/更新日志.txt +++ b/doc/更新日志.txt @@ -1,4 +1,19 @@ +### v1.1.42 更新日志 ### + +新增:分享小程序直播间绑定分销关系 +修复:小程序端ID selectors报错问题 +修复:后台直播间管理置顶报错 +修复:取消确认弹框后未关闭loading +修复:直播间列表为空时同步失败 +修复:收货地址过长发送订阅消息失败 +修复:后台审核拼团订单退货报错 +修复:小程序端未配置订阅消息提交表单 +修复:小程序端秒杀商品分享时无标题 +-------------------------------- +注:本次更新须重新发布小程序 + + ### v1.1.41 更新日志 ### 新增:微信小程序订阅消息 diff --git a/source/application/admin/model/store/Access.php b/source/application/admin/model/store/Access.php index b30557a..f2d5087 100644 --- a/source/application/admin/model/store/Access.php +++ b/source/application/admin/model/store/Access.php @@ -130,13 +130,4 @@ class Access extends AccessModel return $prefix; } - /** - * 新增默认权限 - */ - public function insertDefault() - { - $defaultData = $this->defaultData(); - $this->buildData($defaultData); - } - } \ No newline at end of file diff --git a/source/application/common.php b/source/application/common.php index 15bec98..9a71e5d 100644 --- a/source/application/common.php +++ b/source/application/common.php @@ -221,7 +221,7 @@ function export_excel($fileName, $tileArray = [], $dataArray = []) { ini_set('memory_limit', '512M'); ini_set('max_execution_time', 0); - ob_end_clean(); + // ob_end_clean(); ob_start(); header("Content-Type: text/csv"); header("Content-Disposition:filename=" . $fileName); @@ -356,7 +356,7 @@ function filter_emoji($text) function str_substr($str, $length = 30) { if (strlen($str) > $length) { - $str = mb_substr($str, 0, $length); + $str = mb_substr($str, 0, $length, 'utf-8'); } return $str; } diff --git a/source/application/common/exception/ExceptionHandler.php b/source/application/common/exception/ExceptionHandler.php index ebf4b3d..5ccb9f2 100644 --- a/source/application/common/exception/ExceptionHandler.php +++ b/source/application/common/exception/ExceptionHandler.php @@ -37,13 +37,31 @@ class ExceptionHandler extends Handle return json(['msg' => $this->message, 'code' => $this->code]); } + /** + * Report or log an exception. + * + * @param \Exception $exception + * @return void + */ + public function report(Exception $exception) + { + // 不使用内置的方式记录异常日志 + } + /** * 将异常写入日志 * @param Exception $e */ private function recordErrorLog(Exception $e) { - Log::record($e->getMessage(), 'error'); - Log::record($e->getTraceAsString(), 'error'); + $data = [ + 'file' => $e->getFile(), + 'line' => $e->getLine(), + 'message' => $this->getMessage($e), + 'code' => $this->getCode($e), + ]; + $log = "[{$data['code']}]{$data['message']} [{$data['file']}:{$data['line']}]"; + $log .= "\r\n" . $e->getTraceAsString(); + Log::record($log, 'error'); } } diff --git a/source/application/common/library/wechat/WxBase.php b/source/application/common/library/wechat/WxBase.php index 8fa3bc8..059089b 100644 --- a/source/application/common/library/wechat/WxBase.php +++ b/source/application/common/library/wechat/WxBase.php @@ -3,6 +3,7 @@ namespace app\common\library\wechat; use think\Cache; +use app\common\library\helper; use app\common\exception\BaseException; /** @@ -153,7 +154,7 @@ class WxBase */ protected function jsonEncode($data) { - return json_encode($data, JSON_UNESCAPED_UNICODE); + return helper::jsonEncode($data); } /** @@ -163,7 +164,7 @@ class WxBase */ protected function jsonDecode($json) { - return json_decode($json, true); + return helper::jsonDecode($json); } /** diff --git a/source/application/common/library/wechat/live/Room.php b/source/application/common/library/wechat/live/Room.php index 8eb65ec..1a927fe 100644 --- a/source/application/common/library/wechat/live/Room.php +++ b/source/application/common/library/wechat/live/Room.php @@ -33,7 +33,7 @@ class Room extends WxBase $this->error = 'not found errcode'; return false; } - if ($response['errcode'] != 0) { + if ((int)$response['errcode'] > 1) { $this->error = $response['errmsg']; return false; } diff --git a/source/application/common/model/BaseModel.php b/source/application/common/model/BaseModel.php index f4b8454..9b24e7d 100644 --- a/source/application/common/model/BaseModel.php +++ b/source/application/common/model/BaseModel.php @@ -64,7 +64,7 @@ class BaseModel extends Model protected static function setStoreWxappId() { $session = Session::get('yoshop_store'); - self::$wxapp_id = $session['wxapp']['wxapp_id']; + !empty($session) && self::$wxapp_id = $session['wxapp']['wxapp_id']; } /** diff --git a/source/application/common/model/Category.php b/source/application/common/model/Category.php index 2aeb791..37e0614 100644 --- a/source/application/common/model/Category.php +++ b/source/application/common/model/Category.php @@ -2,6 +2,7 @@ namespace app\common\model; +use app\common\library\helper; use think\Cache; /** @@ -80,7 +81,7 @@ class Category extends BaseModel */ public static function getCacheTreeJson() { - return json_encode(static::getCacheTree()); + return helper::jsonEncode(static::getCacheTree()); } /** diff --git a/source/application/common/model/Goods.php b/source/application/common/model/Goods.php index 0d3f48b..dfca35e 100644 --- a/source/application/common/model/Goods.php +++ b/source/application/common/model/Goods.php @@ -140,7 +140,7 @@ class Goods extends BaseModel } elseif ($params['sortType'] === 'sales') { $sort = ['goods_sales' => 'desc']; } elseif ($params['sortType'] === 'price') { - $sort = $params['sortPrice'] ? ['goods_max_price' => 'desc'] : ['goods_min_price']; + $sort = $params['sortPrice'] ? ['goods_max_price' => 'desc'] : ['goods_min_price' => 'asc']; } // 商品表名称 $tableName = $this->getTable(); diff --git a/source/application/common/model/wxapp/LiveRoom.php b/source/application/common/model/wxapp/LiveRoom.php index 677e3d8..e726cf9 100644 --- a/source/application/common/model/wxapp/LiveRoom.php +++ b/source/application/common/model/wxapp/LiveRoom.php @@ -35,13 +35,13 @@ class LiveRoom extends BaseModel /** * 获取直播间详情 - * @param $roomId + * @param int $id * @return static|null * @throws \think\exception\DbException */ - public static function detail($roomId) + public static function detail($id) { - return static::get($roomId); + return static::get($id); } } \ No newline at end of file diff --git a/source/application/common/service/message/order/Delivery.php b/source/application/common/service/message/order/Delivery.php index de0bb2d..79444f7 100644 --- a/source/application/common/service/message/order/Delivery.php +++ b/source/application/common/service/message/order/Delivery.php @@ -101,7 +101,8 @@ class Delivery extends Basics */ private function getFormatAddress($orderInfo) { - return implode('', $orderInfo['address']['region']) . $orderInfo['address']['detail']; + $address = implode('', $orderInfo['address']['region']) . $orderInfo['address']['detail']; + return $this->getSubstr($address); } /** diff --git a/source/application/store/controller/apps/live/Room.php b/source/application/store/controller/apps/live/Room.php index f5dd0b8..b21932f 100644 --- a/source/application/store/controller/apps/live/Room.php +++ b/source/application/store/controller/apps/live/Room.php @@ -42,15 +42,15 @@ class Room extends Controller /** * 修改直播间置顶状态 - * @param $room_id - * @param $is_top + * @param int $id + * @param int $is_top * @return array|bool * @throws \think\exception\DbException */ - public function settop($room_id, $is_top) + public function settop($id, $is_top) { // 直播间详情 - $model = LiveRoomModel::detail($room_id); + $model = LiveRoomModel::detail($id); if (!$model->setIsTop($is_top)) { return $this->renderError('操作失败'); } diff --git a/source/application/store/model/sharing/OrderRefund.php b/source/application/store/model/sharing/OrderRefund.php index cf6cbeb..aa07a23 100644 --- a/source/application/store/model/sharing/OrderRefund.php +++ b/source/application/store/model/sharing/OrderRefund.php @@ -70,7 +70,7 @@ class OrderRefund extends OrderRefundModel $this->error = '请选择退货地址'; return false; } - $this->transaction(function ($data) { + $this->transaction(function () use ($data) { // 拒绝申请, 标记售后单状态为已拒绝 $data['is_agree'] == 20 && $data['status'] = 10; // 同意换货申请, 标记售后单状态为已完成 diff --git a/source/application/store/view/apps/live/room/index.php b/source/application/store/view/apps/live/room/index.php index 82331cf..13ed7aa 100644 --- a/source/application/store/view/apps/live/room/index.php +++ b/source/application/store/view/apps/live/room/index.php @@ -89,7 +89,7 @@ use app\common\enum\live\LiveStatus as LiveStatusEnum;
¥= $item['order_goods']['total_pay_price'] ?>
= $item['user']['nickName'] ?>
-(用户id:= $item['user']['user_id'] ?>)
+ += $item['user']['nickName'] ?>
+(用户id:= $item['user']['user_id'] ?>)
+ +--
+