Bläddra i källkod

修复已知问题

evoxwht 3 år sedan
förälder
incheckning
7ee125f2bd

+ 1 - 0
crmeb/app/adminapi/common.php

@@ -117,6 +117,7 @@ if (!function_exists('attr_format')) {
         $data = [];
         $res = [];
         $count = count($arr);
+        $arr = array_merge($arr);
         if ($count > 1) {
             for ($i = 0; $i < $count - 1; $i++) {
                 if ($i == 0) $data = $arr[$i]['detail'];

+ 1 - 1
crmeb/app/adminapi/controller/v1/cms/ArticleCategory.php

@@ -147,7 +147,7 @@ class ArticleCategory extends AuthController
      */
     public function categoryList()
     {
-        return app('json')->success($this->service->getArticleCategory());
+        return app('json')->success($this->service->getArticleTwoCategory());
     }
 
     /**

+ 0 - 79
crmeb/app/adminapi/route/statistic.php

@@ -1,79 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
-// +----------------------------------------------------------------------
-// | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
-// +----------------------------------------------------------------------
-// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
-// +----------------------------------------------------------------------
-// | Author: CRMEB Team <admin@crmeb.com>
-// +----------------------------------------------------------------------
-
-use think\facade\Route;
-
-/**
- * 分销管理 相关路由
- */
-Route::group('statistic', function () {
-    /** 用户统计 */
-    //用户基础
-    Route::get('user/get_basic', 'v1.statistic.UserStatistic/getBasic')->option(['real_name' => '用户基础统计']);
-    //用户增长趋势
-    Route::get('user/get_trend', 'v1.statistic.UserStatistic/getTrend')->option(['real_name' => '用户增长趋势']);
-    //微信用户
-    Route::get('user/get_wechat', 'v1.statistic.UserStatistic/getWechat')->option(['real_name' => '微信用户统计']);
-    //微信用户成长趋势
-    Route::get('user/get_wechat_trend', 'v1.statistic.UserStatistic/getWechatTrend')->option(['real_name' => '微信用户成长趋势']);
-    //用户地域排行
-    Route::get('user/get_region', 'v1.statistic.UserStatistic/getRegion')->option(['real_name' => '用户地域排行']);
-    //用户性别
-    Route::get('user/get_sex', 'v1.statistic.UserStatistic/getSex')->option(['real_name' => '用户性别分布']);
-    //商品数据导出
-    Route::get('user/get_excel', 'v1.statistic.UserStatistic/getExcel')->option(['real_name' => '用户数据导出']);
-
-    /** 商品统计 */
-    //商品基础
-    Route::get('product/get_basic', 'v1.statistic.ProductStatistic/getBasic')->option(['real_name' => '商品基础统计']);
-    //商品趋势
-    Route::get('product/get_trend', 'v1.statistic.ProductStatistic/getTrend')->option(['real_name' => '商品趋势']);
-    //商品排行
-    Route::get('product/get_product_ranking', 'v1.statistic.ProductStatistic/getProductRanking')->option(['real_name' => '商品排行']);
-    //商品数据导出
-    Route::get('product/get_excel', 'v1.statistic.ProductStatistic/getExcel')->option(['real_name' => '商品数据导出']);
-
-    /** 交易统计 */
-    //今日营业额统计
-    Route::get('trade/top_trade', 'v1.statistic.TradeStatistic/topTrade')->option(['real_name' => '今日营业额统计']);
-    Route::get('trade/bottom_trade', 'v1.statistic.TradeStatistic/bottomTrade')->option(['real_name' => '交易统计底部数据']);
-
-    /** 订单统计 */
-    //订单基础
-    Route::get('order/get_basic', 'v1.statistic.OrderStatistic/getBasic')->option(['real_name' => '订单基础统计']);
-    //订单趋势
-    Route::get('order/get_trend', 'v1.statistic.OrderStatistic/getTrend')->option(['real_name' => '订单趋势']);
-    //订单来源
-    Route::get('order/get_channel', 'v1.statistic.OrderStatistic/getChannel')->option(['real_name' => '订单来源']);
-    //订单类型
-    Route::get('order/get_type', 'v1.statistic.OrderStatistic/getType')->option(['real_name' => '订单类型']);
-
-    /** 资金流水 */
-    Route::get('flow/get_list', 'v1.statistic.FlowStatistic/getFlowList')->option(['real_name' => '资金流水']);
-    Route::post('flow/set_mark/:id', 'v1.statistic.FlowStatistic/setMark')->option(['real_name' => '设置备注']);
-    Route::get('flow/get_record', 'v1.statistic.FlowStatistic/getFlowRecord')->option(['real_name' => '账单记录']);
-
-    /** 余额统计 */
-    //余额基础统计
-    Route::get('balance/get_basic', 'v1.statistic.BalanceStatistic/getBasic')->option(['real_name' => '余额基础统计']);
-    //余额趋势
-    Route::get('balance/get_trend', 'v1.statistic.BalanceStatistic/getTrend')->option(['real_name' => '余额趋势']);
-    //余额来源
-    Route::get('balance/get_channel', 'v1.statistic.BalanceStatistic/getChannel')->option(['real_name' => '余额来源']);
-    //余额消耗
-    Route::get('balance/get_type', 'v1.statistic.BalanceStatistic/getType')->option(['real_name' => '余额消耗']);
-
-})->middleware([
-    \app\http\middleware\AllowOriginMiddleware::class,
-    \app\adminapi\middleware\AdminAuthTokenMiddleware::class,
-    \app\adminapi\middleware\AdminCkeckRoleMiddleware::class,
-    \app\adminapi\middleware\AdminLogMiddleware::class
-]);

+ 19 - 0
crmeb/app/dao/article/ArticleCategoryDao.php

@@ -60,6 +60,25 @@ class ArticleCategoryDao extends BaseDao
             ->select()->toArray();
     }
 
+    /**
+     * 二级文章分类
+     * @return array
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
+     */
+    public function getArticleTwoCategory()
+    {
+        return $this->getModel()
+            ->where('hidden', 0)
+            ->where('is_del', 0)
+            ->where('status', 1)
+            ->where('pid', '>', 0)
+            ->order('sort DESC')
+            ->field('id,pid,title')
+            ->select()->toArray();
+    }
+
     /**
      * 添加修改选择上级分类列表
      * @param array $where

+ 1 - 1
crmeb/app/dao/product/sku/StoreProductAttrValueDao.php

@@ -74,7 +74,7 @@ class StoreProductAttrValueDao extends BaseDao
      */
     public function getProductAttrValue(array $where)
     {
-        return $this->search($where)->select()->toArray();
+        return $this->search($where)->order('id asc')->select()->toArray();
     }
 
     /**获取属性列表

+ 1 - 1
crmeb/app/services/activity/integral/StorePointRecordServices.php

@@ -54,7 +54,7 @@ class StorePointRecordServices extends BaseServices
         /** @var StoreIntegralOrderServices $integralOrderServices */
         $integralOrderServices = app()->make(StoreIntegralOrderServices::class);
         foreach ($list as &$item) {
-            $item['nickname'] = $nicknameArr[$item['uid']];
+            $item['nickname'] = $nicknameArr[$item['uid']] ?? '未知用户';
             if ($item['type'] == 'gain' || $item['type'] == 'deduction' || $item['type'] == 'product_deduction' || $item['type'] == 'pay_product_integral_back') {
                 $item['relation'] = $orderServices->value(['id' => $item['link_id']], 'order_id');
             } elseif ($item['type'] == 'storeIntegral_use') {

+ 3 - 2
crmeb/app/services/agent/DivisionServices.php

@@ -140,7 +140,7 @@ class DivisionServices extends BaseServices
             'pwd' => $data['pwd'],
             'conf_pwd' => $data['conf_pwd'],
             'real_name' => $data['real_name'],
-            'roles' => $data['roles'],
+            'roles' => implode(',', $data['roles']),
             'status' => 1,
             'level' => 1,
             'division_id' => $uid
@@ -175,8 +175,9 @@ class DivisionServices extends BaseServices
                     if ($adminData['pwd'] != $adminData['conf_pwd']) throw new AdminException('两次输入的密码不一致');
                     $adminInfo->pwd = $this->passwordHash($adminData['pwd']);
                 }
-
                 $adminInfo->real_name = $adminData['real_name'];
+                $adminInfo->account = $adminData['account'];
+                $adminInfo->roles = implode(',', $adminData['roles']);
                 if ($adminInfo->save())
                     return true;
                 else

+ 1 - 0
crmeb/app/services/article/ArticleCategoryServices.php

@@ -22,6 +22,7 @@ use think\facade\Route as Url;
  * Class ArticleCategoryServices
  * @package app\services\article
  * @method getArticleCategory()
+ * @method getArticleTwoCategory()
  */
 class ArticleCategoryServices extends BaseServices
 {

+ 1 - 1
crmeb/app/services/order/StoreOrderComputedServices.php

@@ -442,7 +442,7 @@ class StoreOrderComputedServices extends BaseServices
                 }
                 if (count($storePostage_arr)) {
                     //获取运费计算中的最大值
-                    $storePostage = max($storePostage_arr);
+                    $storePostage = bcadd((string)$storePostage, (string)(max($storePostage_arr)), 2);
                 }
             }
         }

+ 0 - 3
crmeb/app/services/order/StoreOrderRefundServices.php

@@ -503,9 +503,6 @@ class StoreOrderRefundServices extends BaseServices
             } else if ($bargain_id) {
                 $type = 2;
                 $res5 = $res5 && $bargainServices->incBargainStock($cart_num, (int)$bargain_id, $unique);
-            } else if ($advance_id) {
-                $type = 6;
-                $res5 = $res5 && $advanceServices->incAdvanceStock($cart_num, (int)$advance_id, $unique);
             } else {
                 $res5 = $res5 && $services->incProductStock($cart_num, (int)$cart['cart_info']['productInfo']['id'], $unique);
             }

+ 1 - 1
crmeb/app/services/product/product/StoreProductServices.php

@@ -1244,7 +1244,7 @@ class StoreProductServices extends BaseServices
         $siteUrl = sys_config('site_url');
         $storeInfo['image'] = set_file_url($storeInfo['image'], $siteUrl);
         $storeInfo['image_base'] = set_file_url($storeInfo['image'], $siteUrl);
-        $storeInfo['video_link'] = empty($storeInfo['video_link']) ? '' : (strpos($storeInfo['video_link'], 'http') === false ? sys_config('site_url') . $storeInfo['video_link'] : $storeInfo['video_link']);
+        $storeInfo['video_link'] = empty($storeInfo['video_link']) ? '' : (strpos($storeInfo['video_link'], 'http') === false ? (sys_config('site_url') . $storeInfo['video_link']) : $storeInfo['video_link']);
         $storeInfo['fsales'] = $storeInfo['ficti'] + $storeInfo['sales'];
         $storeInfo['custom_form'] = json_decode($storeInfo['custom_form'], true);
         $storeInfo['slider_image'] = set_file_url($storeInfo['slider_image'], $siteUrl);

+ 1 - 1
crmeb/app/services/user/UserBrokerageServices.php

@@ -361,7 +361,7 @@ class UserBrokerageServices extends BaseServices
         $times = [];
         if ($list) {
             foreach ($list as &$item) {
-                $item['time_key'] = $item['add_time'] ? date('Y-m', (int)$item['add_time']) : '';
+                $item['time'] = $item['time_key'] = $item['add_time'] ? date('Y-m', (int)$item['add_time']) : '';
                 $item['add_time'] = $item['add_time'] ? date('Y-m-d H:i', (int)$item['add_time']) : '';
                 $item['fail_msg'] = $item['type'] == 'extract_fail' ? $userExtract[$item['link_id']] : '';
             }

+ 1 - 1
crmeb/app/services/user/UserMoneyServices.php

@@ -347,7 +347,7 @@ class UserMoneyServices extends BaseServices
         $times = [];
         if ($list) {
             foreach ($list as &$item) {
-                $item['time_key'] = $item['add_time'] ? date('Y-m', (int)$item['add_time']) : '';
+                $item['time'] = $item['time_key'] = $item['add_time'] ? date('Y-m', (int)$item['add_time']) : '';
                 $item['add_time'] = $item['add_time'] ? date('Y-m-d H:i', (int)$item['add_time']) : '';
             }
             $times = array_merge(array_unique(array_column($list, 'time_key')));