From 7ee125f2bd6eee3e61bacd5b534726f46682f553 Mon Sep 17 00:00:00 2001 From: evoxwht <442384644@qq.com> Date: Thu, 17 Feb 2022 16:50:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B7=B2=E7=9F=A5=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/app/adminapi/common.php | 1 + .../controller/v1/cms/ArticleCategory.php | 2 +- crmeb/app/adminapi/route/statistic.php | 79 ------------------- crmeb/app/dao/article/ArticleCategoryDao.php | 19 +++++ .../product/sku/StoreProductAttrValueDao.php | 2 +- .../integral/StorePointRecordServices.php | 2 +- crmeb/app/services/agent/DivisionServices.php | 5 +- .../article/ArticleCategoryServices.php | 1 + .../order/StoreOrderComputedServices.php | 2 +- .../order/StoreOrderRefundServices.php | 3 - .../product/product/StoreProductServices.php | 2 +- .../services/user/UserBrokerageServices.php | 2 +- crmeb/app/services/user/UserMoneyServices.php | 2 +- 13 files changed, 31 insertions(+), 91 deletions(-) delete mode 100644 crmeb/app/adminapi/route/statistic.php diff --git a/crmeb/app/adminapi/common.php b/crmeb/app/adminapi/common.php index 4a1bb0413..74380057c 100644 --- a/crmeb/app/adminapi/common.php +++ b/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']; diff --git a/crmeb/app/adminapi/controller/v1/cms/ArticleCategory.php b/crmeb/app/adminapi/controller/v1/cms/ArticleCategory.php index 629296506..2e9b40e8c 100644 --- a/crmeb/app/adminapi/controller/v1/cms/ArticleCategory.php +++ b/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()); } /** diff --git a/crmeb/app/adminapi/route/statistic.php b/crmeb/app/adminapi/route/statistic.php deleted file mode 100644 index 104154e11..000000000 --- a/crmeb/app/adminapi/route/statistic.php +++ /dev/null @@ -1,79 +0,0 @@ - -// +---------------------------------------------------------------------- - -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 -]); diff --git a/crmeb/app/dao/article/ArticleCategoryDao.php b/crmeb/app/dao/article/ArticleCategoryDao.php index f1d466cba..69ae886bd 100644 --- a/crmeb/app/dao/article/ArticleCategoryDao.php +++ b/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 diff --git a/crmeb/app/dao/product/sku/StoreProductAttrValueDao.php b/crmeb/app/dao/product/sku/StoreProductAttrValueDao.php index 174cb69c3..653341159 100644 --- a/crmeb/app/dao/product/sku/StoreProductAttrValueDao.php +++ b/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(); } /**获取属性列表 diff --git a/crmeb/app/services/activity/integral/StorePointRecordServices.php b/crmeb/app/services/activity/integral/StorePointRecordServices.php index 2c0931e76..2f33210d5 100644 --- a/crmeb/app/services/activity/integral/StorePointRecordServices.php +++ b/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') { diff --git a/crmeb/app/services/agent/DivisionServices.php b/crmeb/app/services/agent/DivisionServices.php index 5b8574fab..747f4370d 100644 --- a/crmeb/app/services/agent/DivisionServices.php +++ b/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 diff --git a/crmeb/app/services/article/ArticleCategoryServices.php b/crmeb/app/services/article/ArticleCategoryServices.php index 64efd89d7..e8028f2be 100644 --- a/crmeb/app/services/article/ArticleCategoryServices.php +++ b/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 { diff --git a/crmeb/app/services/order/StoreOrderComputedServices.php b/crmeb/app/services/order/StoreOrderComputedServices.php index e8853078a..5d2146d5a 100644 --- a/crmeb/app/services/order/StoreOrderComputedServices.php +++ b/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); } } } diff --git a/crmeb/app/services/order/StoreOrderRefundServices.php b/crmeb/app/services/order/StoreOrderRefundServices.php index 3e6059e26..3d51e390d 100644 --- a/crmeb/app/services/order/StoreOrderRefundServices.php +++ b/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); } diff --git a/crmeb/app/services/product/product/StoreProductServices.php b/crmeb/app/services/product/product/StoreProductServices.php index 85df872be..8b9c4273e 100644 --- a/crmeb/app/services/product/product/StoreProductServices.php +++ b/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); diff --git a/crmeb/app/services/user/UserBrokerageServices.php b/crmeb/app/services/user/UserBrokerageServices.php index 99c2f974b..6180834b2 100644 --- a/crmeb/app/services/user/UserBrokerageServices.php +++ b/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']] : ''; } diff --git a/crmeb/app/services/user/UserMoneyServices.php b/crmeb/app/services/user/UserMoneyServices.php index 376ee7911..2c666341d 100644 --- a/crmeb/app/services/user/UserMoneyServices.php +++ b/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')));