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; + data-id="" data-istop=""> @@ -137,7 +137,7 @@ use app\common\enum\live\LiveStatus as LiveStatusEnum; , function (index) { var url = ""; $.post(url - , {room_id: data['id'], is_top: Number(!(parseInt(data['istop']) === 1))} + , {id: data['id'], is_top: Number(!(parseInt(data['istop']) === 1))} , function (result) { result['code'] === 1 ? $.show_success(result['msg'], result['url']) : $.show_error(result['msg']); diff --git a/source/application/store/view/apps/sharing/order/detail.php b/source/application/store/view/apps/sharing/order/detail.php index 1e29e65..272adc3 100644 --- a/source/application/store/view/apps/sharing/order/detail.php +++ b/source/application/store/view/apps/sharing/order/detail.php @@ -686,6 +686,7 @@ $detail = isset($detail) ? $detail : null; : $.show_error(result.msg); } }); + return true; } }); }); diff --git a/source/application/store/view/order/detail.php b/source/application/store/view/order/detail.php index a08bd98..d922e1a 100644 --- a/source/application/store/view/order/detail.php +++ b/source/application/store/view/order/detail.php @@ -598,6 +598,7 @@ $detail = isset($detail) ? $detail : null; : $.show_error(result.msg); } }); + return true; } }); }); diff --git a/source/application/store/view/order/refund/index.php b/source/application/store/view/order/refund/index.php index 40d15f0..439df18 100644 --- a/source/application/store/view/order/refund/index.php +++ b/source/application/store/view/order/refund/index.php @@ -110,8 +110,12 @@

-

- + +

+ + +

--

+ diff --git a/source/application/store/view/user/index.php b/source/application/store/view/user/index.php index 7319937..4f5ca48 100644 --- a/source/application/store/view/user/index.php +++ b/source/application/store/view/user/index.php @@ -161,7 +161,7 @@ - 暂无记录 + 暂无记录 diff --git a/source/application/store/view/user/recharge/order.php b/source/application/store/view/user/recharge/order.php index 08cad4c..d74fa6f 100644 --- a/source/application/store/view/user/recharge/order.php +++ b/source/application/store/view/user/recharge/order.php @@ -104,7 +104,7 @@ "> - + diff --git a/source/application/store/view/wxapp/submsg/index.php b/source/application/store/view/wxapp/submsg/index.php index ac22659..8ff95b4 100644 --- a/source/application/store/view/wxapp/submsg/index.php +++ b/source/application/store/view/wxapp/submsg/index.php @@ -123,10 +123,10 @@ // 一键配置 $('.j-shuttle').on('click', function () { var url = ""; - var load = layer.load(); layer.confirm('该操作将自动为您的小程序添加订阅消息
请先确保 "订阅消息" - "我的模板" 中没有记录
确定添加吗?', { title: '友情提示' }, function (index) { + var load = layer.load(); $.post(url, {}, function (result) { result.code === 1 ? $.show_success(result.msg, result.url) : $.show_error(result.msg); diff --git a/source/thinkphp/library/think/db/Query.php b/source/thinkphp/library/think/db/Query.php index ac4adea..fce9065 100644 --- a/source/thinkphp/library/think/db/Query.php +++ b/source/thinkphp/library/think/db/Query.php @@ -397,7 +397,7 @@ class Query $seq = (ord(substr($type($value), 0, 1)) % $rule['num']) + 1; } else { // 按照字段的首字母的值分表 - $seq = (ord($value{0}) % $rule['num']) + 1; + $seq = (ord($value[0]) % $rule['num']) + 1; } } return $this->getTable() . '_' . $seq; diff --git a/version.json b/version.json index 53f36d4..073a062 100644 --- a/version.json +++ b/version.json @@ -1,3 +1,3 @@ { - "version": "1.1.41" + "version": "1.1.42" }