From 99501a40e7ad45f50f1107c9e025b959f8ddee4c Mon Sep 17 00:00:00 2001
From: evoxwht <442384644@qq.com>
Date: Fri, 24 Mar 2023 15:16:13 +0800
Subject: [PATCH 1/5] =?UTF-8?q?=E4=BC=9A=E5=91=98=E5=8D=A1=E6=90=9C?=
=?UTF-8?q?=E7=B4=A2=E4=BB=A5=E5=8F=8A=E5=AF=BC=E5=87=BA=E5=AD=97=E6=AE=B5?=
=?UTF-8?q?=E4=B8=8D=E4=B8=80=E8=87=B4=E7=9A=84=E9=97=AE=E9=A2=98=E5=A4=84?=
=?UTF-8?q?=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../v1/user/member/MemberCardBatch.php | 5 ++---
crmeb/app/model/user/MemberCardBatch.php | 2 +-
.../user/member/MemberCardBatchServices.php | 4 ++++
.../services/user/member/MemberCardServices.php | 17 ++++++++---------
4 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/crmeb/app/adminapi/controller/v1/user/member/MemberCardBatch.php b/crmeb/app/adminapi/controller/v1/user/member/MemberCardBatch.php
index 310c37bd1..2659105ea 100644
--- a/crmeb/app/adminapi/controller/v1/user/member/MemberCardBatch.php
+++ b/crmeb/app/adminapi/controller/v1/user/member/MemberCardBatch.php
@@ -43,14 +43,13 @@ class MemberCardBatch extends AuthController
{
$where = $this->request->getMore([
['title', ''],
-// ['page', 1],
-// ['limit', 20],
]);
$data = $this->services->getList($where);
return app('json')->success($data);
}
- /** 保存卡片资源
+ /**
+ * 保存卡片资源
* @param $id
* @return mixed
*/
diff --git a/crmeb/app/model/user/MemberCardBatch.php b/crmeb/app/model/user/MemberCardBatch.php
index d8265dc25..99da55340 100644
--- a/crmeb/app/model/user/MemberCardBatch.php
+++ b/crmeb/app/model/user/MemberCardBatch.php
@@ -45,7 +45,7 @@ class MemberCardBatch extends BaseModel
public function searchTitleAttr($query, $value)
{
if ($value !== '') {
- $query->where('title', $value);
+ $query->where('title', 'like', '%' . $value . '%');
}
}
diff --git a/crmeb/app/services/user/member/MemberCardBatchServices.php b/crmeb/app/services/user/member/MemberCardBatchServices.php
index 0fa653143..20a74ee05 100644
--- a/crmeb/app/services/user/member/MemberCardBatchServices.php
+++ b/crmeb/app/services/user/member/MemberCardBatchServices.php
@@ -32,6 +32,10 @@ class MemberCardBatchServices extends BaseServices
/**
* 获取会员卡批次列表
* @param array $where
+ * @return array
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function getList(array $where = [])
{
diff --git a/crmeb/app/services/user/member/MemberCardServices.php b/crmeb/app/services/user/member/MemberCardServices.php
index ac8be37a2..c5ff1beb8 100644
--- a/crmeb/app/services/user/member/MemberCardServices.php
+++ b/crmeb/app/services/user/member/MemberCardServices.php
@@ -49,16 +49,15 @@ class MemberCardServices extends BaseServices
}
unset($where['is_use']);
$list = $this->dao->getSearchList($where, $page, $limit);
- if ($list) {
- foreach ($list as $k => $v) {
- if ($v['use_uid']) {
- $user_info = $userService->getUserInfo($v['use_uid'], ['nickname', 'phone', 'real_name']);
- $list[$k]['username'] = $user_info['real_name'] ? $user_info['real_name'] : $user_info['nickname'];
- $list[$k]['phone'] = $user_info ? $user_info['phone'] : "";
- }
- $list[$k]['add_time'] = date('Y-m-d H:i:s', $v['add_time']);
- $list[$k]['use_time'] = $v['use_time'] != 0 ? date('Y-m-d H:i:s', $v['use_time']) : "未使用";
+ $userIds = array_column($list->toArray(), 'use_uid');
+ $userList = $userService->getColumn([['uid', 'in', $userIds]], 'nickname,phone,real_name', 'uid');
+ foreach ($list as $k => $v) {
+ if ($v['use_uid']) {
+ $list[$k]['username'] = $userList[$v['use_uid']]['real_name'] ?: $userList[$v['use_uid']]['nickname'];
+ $list[$k]['phone'] = $userList[$v['use_uid']] ? $userList[$v['use_uid']]['phone'] : "";
}
+ $list[$k]['add_time'] = date('Y-m-d H:i:s', $v['add_time']);
+ $list[$k]['use_time'] = $v['use_time'] != 0 ? date('Y-m-d H:i:s', $v['use_time']) : "未使用";
}
$count = $this->dao->count($where);
return compact('list', 'count');
From dccfdfbe5e660317dd5014447af329535bf0db5f Mon Sep 17 00:00:00 2001
From: evoxwht <442384644@qq.com>
Date: Fri, 24 Mar 2023 15:16:59 +0800
Subject: [PATCH 2/5] =?UTF-8?q?=E5=8F=91=E7=A5=A8=E5=90=8E=E5=8F=B0?=
=?UTF-8?q?=E6=90=9C=E7=B4=A2=E4=BB=A5=E5=8F=8A=E7=BC=96=E8=BE=91=E6=97=B6?=
=?UTF-8?q?=E5=80=99=E7=9A=84=E5=AD=97=E6=AE=B5=E4=B8=8D=E4=B8=80=E8=87=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../controller/v1/order/StoreOrderInvoice.php | 2 ++
.../order/StoreOrderInvoiceServices.php | 17 ++++++++++++-----
.../admin/src/pages/order/invoice/index.vue | 5 +++--
3 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/crmeb/app/adminapi/controller/v1/order/StoreOrderInvoice.php b/crmeb/app/adminapi/controller/v1/order/StoreOrderInvoice.php
index 885ca417f..8a7b07b4f 100644
--- a/crmeb/app/adminapi/controller/v1/order/StoreOrderInvoice.php
+++ b/crmeb/app/adminapi/controller/v1/order/StoreOrderInvoice.php
@@ -45,6 +45,8 @@ class StoreOrderInvoice extends AuthController
{
$where = $this->request->getMore([
['data', '', '', 'time'],
+ ['real_name', ''],
+ ['field_key', ''],
[['type', 'd'], 0],
]);
$data = $this->services->chart($where);
diff --git a/crmeb/app/services/order/StoreOrderInvoiceServices.php b/crmeb/app/services/order/StoreOrderInvoiceServices.php
index 3e76fc10a..475c6606d 100644
--- a/crmeb/app/services/order/StoreOrderInvoiceServices.php
+++ b/crmeb/app/services/order/StoreOrderInvoiceServices.php
@@ -36,21 +36,28 @@ class StoreOrderInvoiceServices extends BaseServices
public function chart(array $where)
{
+ $where['is_pay'] = 1;
//全部
- $data['all'] = (string)$this->dao->count(['is_pay' => 1, 'time' => $where['time']]);
+ $data['all'] = (string)$this->dao->count($where);
//待开
- $data['noOpened'] = (string)$this->dao->count(['is_pay' => 1, 'time' => $where['time'], 'type' => 1]);
+ $where['type'] = 1;
+ $data['noOpened'] = (string)$this->dao->count($where);
//已开
- $data['opened'] = (string)$this->dao->count(['is_pay' => 1, 'time' => $where['time'], 'type' => 2]);
+ $where['type'] = 2;
+ $data['opened'] = (string)$this->dao->count($where);
//退款
- $data['refund'] = (string)$this->dao->count(['is_pay' => 1, 'time' => $where['time'], 'type' => 3]);
+ $where['type'] = 3;
+ $data['refund'] = (string)$this->dao->count($where);
return $data;
}
/**
* 后台获取开票列表
- * @param $where
+ * @param array $where
* @return array
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function getList(array $where)
{
diff --git a/template/admin/src/pages/order/invoice/index.vue b/template/admin/src/pages/order/invoice/index.vue
index 85e490bee..e322afdab 100644
--- a/template/admin/src/pages/order/invoice/index.vue
+++ b/template/admin/src/pages/order/invoice/index.vue
@@ -151,7 +151,7 @@
联系信息
- 真实姓名: {{ invoiceDetails.real_name }}
+ 真实姓名: {{ invoiceDetails.name }}
联系电话: {{ invoiceDetails.user_phone }}
@@ -178,7 +178,7 @@
联系信息
- 真实姓名: {{ invoiceDetails.real_name }}
+ 真实姓名: {{ invoiceDetails.name }}
联系电话: {{ invoiceDetails.user_phone }}
@@ -555,6 +555,7 @@ export default {
this.timeVal = e;
this.orderData.data = this.timeVal[0] ? this.timeVal.join('-') : '';
this.getList();
+ this.getTabs();
},
//订单状态搜索()
selectChange() {
From 5364f2d2296b050000f2e3b6a64ff68f682e0011 Mon Sep 17 00:00:00 2001
From: evoxwht <442384644@qq.com>
Date: Fri, 24 Mar 2023 15:17:20 +0800
Subject: [PATCH 3/5] =?UTF-8?q?=E6=96=87=E7=AB=A0=E5=88=86=E7=B1=BB?=
=?UTF-8?q?=E6=90=9C=E7=B4=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
crmeb/app/dao/article/ArticleCategoryDao.php | 6 +++++-
.../article/ArticleCategoryServices.php | 17 ++++-------------
2 files changed, 9 insertions(+), 14 deletions(-)
diff --git a/crmeb/app/dao/article/ArticleCategoryDao.php b/crmeb/app/dao/article/ArticleCategoryDao.php
index 9abee485c..275d6c9d6 100644
--- a/crmeb/app/dao/article/ArticleCategoryDao.php
+++ b/crmeb/app/dao/article/ArticleCategoryDao.php
@@ -32,11 +32,15 @@ class ArticleCategoryDao extends BaseDao
}
/**
- * 获取文章列表
+ * 获取文章分类列表
* @param array $where
* @param int $page
* @param int $limit
* @return mixed
+ * @throws \ReflectionException
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function getList(array $where, int $page = 0, int $limit = 0)
{
diff --git a/crmeb/app/services/article/ArticleCategoryServices.php b/crmeb/app/services/article/ArticleCategoryServices.php
index 6b11513f4..4d8957ea3 100644
--- a/crmeb/app/services/article/ArticleCategoryServices.php
+++ b/crmeb/app/services/article/ArticleCategoryServices.php
@@ -39,23 +39,14 @@ class ArticleCategoryServices extends BaseServices
* 获取文章分类列表
* @param array $where
* @return array
+ * @throws \ReflectionException
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function getList(array $where)
{
- [$page, $limit] = $this->getPageValue();
$list = $this->dao->getList($where);
- if (!empty($list) && $where['title'] !== '') {
- $pids = Arr::getUniqueKey($list, 'pid');
- $parentList = $this->dao->getList(['id' => $pids]);
- $list = array_merge($list, $parentList);
- foreach ($list as $key => $item) {
- $arr = $item;
- unset($list[$key]);
- if (!in_array($arr, $list)) {
- $list[] = $arr;
- }
- }
- }
$list = get_tree_children($list);
$count = $this->dao->count($where);
return compact('list', 'count');
From 705dcbe494b56c8a95dfce9a589e5560cf120ac3 Mon Sep 17 00:00:00 2001
From: evoxwht <442384644@qq.com>
Date: Fri, 24 Mar 2023 15:18:39 +0800
Subject: [PATCH 4/5] =?UTF-8?q?=E4=BC=9A=E5=91=98=E5=8D=A1=E5=AF=BC?=
=?UTF-8?q?=E5=87=BA=E4=BC=98=E5=8C=96=EF=BC=8C=E7=83=AD=E9=97=A8=E5=95=86?=
=?UTF-8?q?=E5=93=81=E6=8E=A5=E5=8F=A3=E5=A2=9E=E5=8A=A0vip=E9=87=91?=
=?UTF-8?q?=E9=A2=9D=E5=AD=97=E6=AE=B5=EF=BC=8C=E7=A7=BB=E5=8A=A8=E7=AB=AF?=
=?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=AE=A1=E7=90=86=E5=A4=84=E7=90=86=E6=95=B0?=
=?UTF-8?q?=E6=8D=AE=E4=B8=8D=E7=BB=9F=E4=B8=80=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
crmeb/app/dao/order/StoreOrderDao.php | 4 ++--
crmeb/app/services/other/export/ExportServices.php | 10 ++++++++--
.../services/product/product/StoreProductServices.php | 2 +-
3 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/crmeb/app/dao/order/StoreOrderDao.php b/crmeb/app/dao/order/StoreOrderDao.php
index d99febb71..a0013db6f 100644
--- a/crmeb/app/dao/order/StoreOrderDao.php
+++ b/crmeb/app/dao/order/StoreOrderDao.php
@@ -495,7 +495,7 @@ class StoreOrderDao extends BaseDao
*/
public function chartTimePrice($start, $stop)
{
- return $this->search(['is_del' => 0, 'paid' => 1, 'refund_status' => 0])
+ return $this->search(['pid' => 0, 'is_del' => 0, 'paid' => 1, 'refund_status' => [0, 3]])
->where('add_time', '>=', $start)
->where('add_time', '<', $stop)
->field('sum(pay_price) as num,FROM_UNIXTIME(add_time, \'%Y-%m-%d\') as time')
@@ -511,7 +511,7 @@ class StoreOrderDao extends BaseDao
*/
public function chartTimeNumber($start, $stop)
{
- return $this->search(['is_del' => 0, 'paid' => 1, 'refund_status' => 0])
+ return $this->search(['pid' => 0, 'is_del' => 0, 'paid' => 1, 'refund_status' => [0, 3]])
->where('add_time', '>=', $start)
->where('add_time', '<', $stop)
->field('count(id) as num,FROM_UNIXTIME(add_time, \'%Y-%m-%d\') as time')
diff --git a/crmeb/app/services/other/export/ExportServices.php b/crmeb/app/services/other/export/ExportServices.php
index 3648a37ac..f459cf372 100644
--- a/crmeb/app/services/other/export/ExportServices.php
+++ b/crmeb/app/services/other/export/ExportServices.php
@@ -336,13 +336,19 @@ class ExportServices extends BaseServices
$filename = $data['title'] . '批次列表_' . date('YmdHis', time());
$export = $fileKey = [];
if (!empty($data['data'])) {
+ $userIds = array_column($data['data']->toArray(), 'use_uid');
+ /** @var UserServices $userService */
+ $userService = app()->make(UserServices::class);
+ $userList = $userService->getColumn([['uid', 'in', $userIds]], 'nickname,phone,real_name', 'uid');
+
+
$i = 0;
foreach ($data['data'] as $item) {
$one_data = [
'card_number' => $item['card_number'],
'card_password' => $item['card_password'],
- 'user_name' => $item['user_name'],
- 'user_phone' => $item['user_phone'],
+ 'user_name' => $userList[$item['use_uid']]['real_name'] ?: $userList[$item['use_uid']]['nickname'],
+ 'user_phone' => $userList[$item['use_uid']] ? $userList[$item['use_uid']]['phone'] : "",
'use_time' => $item['use_time'],
'use_uid' => $item['use_uid'] ? '已领取' : '未领取'
];
diff --git a/crmeb/app/services/product/product/StoreProductServices.php b/crmeb/app/services/product/product/StoreProductServices.php
index 1de8d206b..9c6956c5d 100644
--- a/crmeb/app/services/product/product/StoreProductServices.php
+++ b/crmeb/app/services/product/product/StoreProductServices.php
@@ -1259,7 +1259,7 @@ class StoreProductServices extends BaseServices
$page = 1;
$limit = $num;
}
- $list = $this->dao->getSearchList($where, $page, $limit, ['id,store_name,cate_id,image,IFNULL(sales, 0) + IFNULL(ficti, 0) as sales,price,stock,activity,unit_name,presale']);
+ $list = $this->dao->getSearchList($where, $page, $limit, ['id,store_name,cate_id,image,IFNULL(sales, 0) + IFNULL(ficti, 0) as sales,price,stock,activity,unit_name,presale,is_vip,vip_price']);
$list = $this->getActivityList($list);
return $list;
}
From fd2f6b3a23d5023a7574b229d217f563adafadf5 Mon Sep 17 00:00:00 2001
From: evoxwht <442384644@qq.com>
Date: Fri, 24 Mar 2023 16:05:01 +0800
Subject: [PATCH 5/5] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=AE=A1=E7=90=86?=
=?UTF-8?q?=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85=E9=97=AE=E9=A2=98=E5=A4=84?=
=?UTF-8?q?=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../controller/v1/admin/StoreOrderController.php | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/crmeb/app/api/controller/v1/admin/StoreOrderController.php b/crmeb/app/api/controller/v1/admin/StoreOrderController.php
index 85d535aa3..2bdcd8f91 100644
--- a/crmeb/app/api/controller/v1/admin/StoreOrderController.php
+++ b/crmeb/app/api/controller/v1/admin/StoreOrderController.php
@@ -15,6 +15,7 @@ use app\services\order\DeliveryServiceServices;
use app\services\order\StoreOrderCartInfoServices;
use app\services\order\StoreOrderCreateServices;
use app\services\order\StoreOrderDeliveryServices;
+use app\services\order\StoreOrderEconomizeServices;
use app\services\order\StoreOrderRefundServices;
use app\services\order\StoreOrderServices;
use app\services\order\StoreOrderWapServices;
@@ -105,17 +106,16 @@ class StoreOrderController
* @param UserServices $userServices
* @param $orderId
* @return mixed
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function detail(Request $request, StoreOrderServices $services, UserServices $userServices, $orderId)
{
- $order = $this->service->getOne(['order_id' => $orderId], '*', ['pink']);
- if (!$order) return app('json')->fail(410173);
- $order = $order->toArray();
- $nickname = $userServices->value(['uid' => $order['uid']], 'nickname');
- $orderInfo = $services->tidyOrder($order, true);
- unset($orderInfo['uid'], $orderInfo['seckill_id'], $orderInfo['pink_id'], $orderInfo['combination_id'], $orderInfo['bargain_id'], $orderInfo['status'], $orderInfo['total_postage']);
- $orderInfo['nickname'] = $nickname;
- return app('json')->success($orderInfo);
+ $economizeServices = app()->make(StoreOrderEconomizeServices::class);
+ $orderData = $services->getUserOrderByKey($economizeServices, $orderId, (int)$request->uid());
+ $orderData['nickname'] = $userServices->value(['uid' => $orderData['uid']], 'nickname');
+ return app('json')->success($orderData);
}
/**