diff --git a/crmeb/app/adminapi/common.php b/crmeb/app/adminapi/common.php index 4a1bb041..74380057 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 62929650..2e9b40e8 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/controller/v1/statistic/FlowStatistic.php b/crmeb/app/adminapi/controller/v1/statistic/FlowStatistic.php new file mode 100644 index 00000000..54962869 --- /dev/null +++ b/crmeb/app/adminapi/controller/v1/statistic/FlowStatistic.php @@ -0,0 +1,74 @@ + +// +---------------------------------------------------------------------- + +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); + } +} diff --git a/crmeb/app/dao/article/ArticleCategoryDao.php b/crmeb/app/dao/article/ArticleCategoryDao.php index f1d466cb..69ae886b 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 174cb69c..65334115 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 2c0931e7..2f33210d 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 5b8574fa..747f4370 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 64efd89d..e8028f2b 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 e8853078..5d2146d5 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 3e6059e2..3d51e390 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/order/StoreOrderSplitServices.php b/crmeb/app/services/order/StoreOrderSplitServices.php index 3c4413fa..d27f2082 100644 --- a/crmeb/app/services/order/StoreOrderSplitServices.php +++ b/crmeb/app/services/order/StoreOrderSplitServices.php @@ -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], '*'); diff --git a/crmeb/app/services/product/product/StoreProductServices.php b/crmeb/app/services/product/product/StoreProductServices.php index 85df872b..8b9c4273 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 99c2f974..6180834b 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 376ee791..2c666341 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')));