fix 修复已知问题

This commit is contained in:
evoxwht 2022-02-18 09:40:14 +08:00
parent 2fcbe8a231
commit 91b2358982
14 changed files with 106 additions and 13 deletions

View File

@ -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'];

View File

@ -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());
}
/**

View File

@ -0,0 +1,74 @@
<?php
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
namespace app\adminapi\controller\v1\statistic;
use app\adminapi\controller\AuthController;
use app\services\statistic\CapitalFlowServices;
use think\facade\App;
class FlowStatistic extends AuthController
{
/**
* @param App $app
* @param CapitalFlowServices $services
*/
public function __construct(App $app, CapitalFlowServices $services)
{
parent::__construct($app);
$this->services = $services;
}
/**
* 资金流水
* @return mixed
*/
public function getFlowList()
{
$where = $this->request->getMore([
['time', ''],
['trading_type', 0],
['keywords', ''],
['ids', ''],
['export', 0]
]);
$date = $this->services->getFlowList($where);
return app('json')->success($date);
}
/**
* 资金流水备注
* @param $id
* @return mixed
*/
public function setMark($id)
{
$data = $this->request->postMore([
['mark', '']
]);
$this->services->setMark($id, $data);
return app('json')->success('备注成功!');
}
/**
* 账单记录
* @return mixed
*/
public function getFlowRecord()
{
$where = $this->request->getMore([
['type', 'day'],
['time', '']
]);
$data = $this->services->getFlowRecord($where);
return app('json')->success($data);
}
}

View File

@ -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

View File

@ -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();
}
/**获取属性列表

View File

@ -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') {

View File

@ -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

View File

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

View File

@ -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);
}
}
}

View File

@ -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);
}

View File

@ -82,7 +82,7 @@ class StoreOrderSplitServices extends BaseServices
$other_cart_ids[] = $other;
}
$cart_ids_arr = ['new' => $cart_ids, 'other' => $other_cart_ids];
if (empty($cart_ids_arr['other'])) return $old_order;
if (empty($cart_ids_arr['other'])) return [$old_order, ['id' => 0]];
return $this->transaction(function () use ($id, $cart_ids_arr, $orderInfo, $orderInfoOld, $cartInfo, $storeOrderCreateServices, $storeOrderCartInfoServices, $statusService) {
$order = $otherOrder = [];
$statusData = $statusService->getColumn(['oid' => $id], '*');

View File

@ -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);

View File

@ -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']] : '';
}

View File

@ -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')));