diff --git a/crmeb/app/adminapi/controller/v1/cms/ArticleCategory.php b/crmeb/app/adminapi/controller/v1/cms/ArticleCategory.php
index 1a666b5ac..c45019d41 100644
--- a/crmeb/app/adminapi/controller/v1/cms/ArticleCategory.php
+++ b/crmeb/app/adminapi/controller/v1/cms/ArticleCategory.php
@@ -165,10 +165,14 @@ class ArticleCategory extends AuthController
/**
* 树形列表
* @return mixed
+ * @throws \ReflectionException
*/
public function getTreeList()
{
$list = $this->service->getTreeList();
+ foreach ($list as &$item) {
+ $item['disabled'] = !$item['status'] || $item['is_del'];
+ }
return app('json')->success($list);
}
}
diff --git a/crmeb/app/adminapi/controller/v1/marketing/StoreSeckill.php b/crmeb/app/adminapi/controller/v1/marketing/StoreSeckill.php
index ce01afc52..6d359ec66 100644
--- a/crmeb/app/adminapi/controller/v1/marketing/StoreSeckill.php
+++ b/crmeb/app/adminapi/controller/v1/marketing/StoreSeckill.php
@@ -135,7 +135,11 @@ class StoreSeckill extends AuthController
/**
* 秒杀统计
+ * @param $id
* @return mixed
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function seckillStatistics($id)
{
@@ -151,7 +155,7 @@ class StoreSeckill extends AuthController
public function seckillPeople($id)
{
[$keyword] = $this->request->getMore([
- ['keyword', '']
+ ['real_name', '', '', 'keyword']
], true);
return app('json')->success($this->services->seckillPeople($id, $keyword));
}
diff --git a/crmeb/app/adminapi/controller/v1/marketing/integral/StorePointRecord.php b/crmeb/app/adminapi/controller/v1/marketing/integral/StorePointRecord.php
index 2a17e827c..e0095979f 100644
--- a/crmeb/app/adminapi/controller/v1/marketing/integral/StorePointRecord.php
+++ b/crmeb/app/adminapi/controller/v1/marketing/integral/StorePointRecord.php
@@ -37,7 +37,7 @@ class StorePointRecord extends AuthController
{
$where = $this->request->getMore([
['time', ''],
- ['trading_type', 0]
+ ['trading_type', '']
]);
$date = $this->services->pointRecord($where);
return app('json')->success($date);
diff --git a/crmeb/app/adminapi/controller/v1/marketing/lottery/LuckLottery.php b/crmeb/app/adminapi/controller/v1/marketing/lottery/LuckLottery.php
index 86e4b3417..439394773 100644
--- a/crmeb/app/adminapi/controller/v1/marketing/lottery/LuckLottery.php
+++ b/crmeb/app/adminapi/controller/v1/marketing/lottery/LuckLottery.php
@@ -85,6 +85,9 @@ class LuckLottery extends AuthController
/**
* 添加抽奖
* @return mixed
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function add()
{
diff --git a/crmeb/app/adminapi/controller/v1/order/RefundOrder.php b/crmeb/app/adminapi/controller/v1/order/RefundOrder.php
index 0c4cd2936..fbb9c5b4b 100644
--- a/crmeb/app/adminapi/controller/v1/order/RefundOrder.php
+++ b/crmeb/app/adminapi/controller/v1/order/RefundOrder.php
@@ -146,7 +146,7 @@ class RefundOrder extends AuthController
return app('json')->fail(400144);
}
- if ($data['type'] == 1) {
+ if ($data['type'] == 1 || $data['type'] == 5) {
$data['refund_type'] = 6;
} else if ($data['type'] == 2) {
$data['refund_type'] = 3;
@@ -190,7 +190,8 @@ class RefundOrder extends AuthController
$refund_data['open_id'] = $wechatUserServices->uidToOpenid((int)$order['uid'], 'routine') ?? '';
$refund_data['refund_no'] = $orderRefund['order_id'];
//修改订单退款状态
- $data['refund_price'] = $data['refunded_price'];
+// $data['refund_price'] = $data['refunded_price'];
+ unset($data['refund_price']);
if ($this->services->agreeRefund($id, $refund_data)) {
$this->services->update($id, $data);
return app('json')->success(400149);
diff --git a/crmeb/app/adminapi/controller/v1/order/StoreOrder.php b/crmeb/app/adminapi/controller/v1/order/StoreOrder.php
index 25835f3c5..4bf6f7c0a 100644
--- a/crmeb/app/adminapi/controller/v1/order/StoreOrder.php
+++ b/crmeb/app/adminapi/controller/v1/order/StoreOrder.php
@@ -263,6 +263,9 @@ class StoreOrder extends AuthController
* @param $id
* @param StoreOrderDeliveryServices $services
* @return mixed
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function split_delivery($id, StoreOrderDeliveryServices $services)
{
@@ -317,7 +320,11 @@ class StoreOrder extends AuthController
/**
* 获取订单拆分子订单列表
+ * @param $id
* @return mixed
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function split_order($id)
{
@@ -455,10 +462,11 @@ class StoreOrder extends AuthController
* 订单详情
* @param $id 订单id
* @return mixed
+ * @throws \ReflectionException
*/
public function order_info($id)
{
- if (!$id || !($orderInfo = $this->services->get($id))) {
+ if (!$id || !($orderInfo = $this->services->get($id, [], ['refund']))) {
return app('json')->fail(400118);
}
/** @var UserServices $services */
@@ -497,6 +505,13 @@ class StoreOrder extends AuthController
} else
$orderInfo['_store_name'] = '';
$orderInfo['spread_name'] = $services->value(['uid' => $orderInfo['spread_uid']], 'nickname') ?? '无';
+ $orderInfo['_info'] = app()->make(StoreOrderCartInfoServices::class)->getOrderCartInfo((int)$orderInfo['id']);
+ $cart_num = 0;
+ $refund_num = array_sum(array_column($orderInfo['refund'], 'refund_num'));
+ foreach ($orderInfo['_info'] as $items) {
+ $cart_num += $items['cart_info']['cart_num'];
+ }
+ $orderInfo['is_all_refund'] = $refund_num == $cart_num;
$userInfo = $userInfo->toArray();
return app('json')->success(compact('orderInfo', 'userInfo'));
}
@@ -551,6 +566,7 @@ class StoreOrder extends AuthController
/**
* 不退款表单结构
+ * @param StoreOrderRefundServices $services
* @param $id
* @return mixed
* @throws \FormBuilder\Exception\FormBuilderException
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/adminapi/controller/v1/product/StoreCategory.php b/crmeb/app/adminapi/controller/v1/product/StoreCategory.php
index e908140c0..3b1c213b1 100644
--- a/crmeb/app/adminapi/controller/v1/product/StoreCategory.php
+++ b/crmeb/app/adminapi/controller/v1/product/StoreCategory.php
@@ -57,7 +57,11 @@ class StoreCategory extends AuthController
/**
* 商品分类搜索
+ * @param $type
* @return mixed
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function tree_list($type)
{
@@ -103,6 +107,9 @@ class StoreCategory extends AuthController
/**
* 保存新增分类
* @return mixed
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function save()
{
@@ -133,6 +140,9 @@ class StoreCategory extends AuthController
* 更新分类
* @param $id
* @return mixed
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function update($id)
{
diff --git a/crmeb/app/adminapi/controller/v1/setting/SystemNotification.php b/crmeb/app/adminapi/controller/v1/setting/SystemNotification.php
index 4b9d8571e..a2a5b3d0b 100644
--- a/crmeb/app/adminapi/controller/v1/setting/SystemNotification.php
+++ b/crmeb/app/adminapi/controller/v1/setting/SystemNotification.php
@@ -34,8 +34,10 @@ class SystemNotification extends AuthController
/**
* 显示资源列表
- *
* @return \think\Response
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function index()
{
@@ -47,8 +49,10 @@ class SystemNotification extends AuthController
/**
* 显示编辑
- *
* @return \think\Response
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function info()
{
diff --git a/crmeb/app/adminapi/controller/v1/user/User.php b/crmeb/app/adminapi/controller/v1/user/User.php
index db6501581..ef60567ac 100644
--- a/crmeb/app/adminapi/controller/v1/user/User.php
+++ b/crmeb/app/adminapi/controller/v1/user/User.php
@@ -170,6 +170,9 @@ class User extends AuthController
* 获取用户账户详情
* @param $id
* @return mixed
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function read($id)
{
@@ -194,6 +197,9 @@ class User extends AuthController
* 执行赠送会员等级
* @param $id
* @return mixed
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function save_give_level($id)
{
@@ -208,6 +214,7 @@ class User extends AuthController
* 赠送付费会员时长表单
* @param $id
* @return mixed
+ * @throws \FormBuilder\Exception\FormBuilderException
*/
public function give_level_time($id)
{
@@ -219,6 +226,9 @@ class User extends AuthController
* 执行赠送付费会员时长
* @param $id
* @return mixed
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function save_give_level_time($id)
{
@@ -387,6 +397,9 @@ class User extends AuthController
if ($data['phone']) {
if (!preg_match("/^1[3456789]\d{9}$/", $data['phone'])) return app('json')->fail(400252);
}
+ if ($this->services->count(['phone' => $data['phone'], 'is_del' => 0, 'not_uid' => $id])) {
+ return app('json')->fail(400314);
+ }
if ($data['card_id']) {
if (!check_card($data['card_id'])) return app('json')->fail(400315);
}
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/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);
}
/**
diff --git a/crmeb/app/api/controller/v1/order/StoreOrderController.php b/crmeb/app/api/controller/v1/order/StoreOrderController.php
index f27603e93..40643831f 100644
--- a/crmeb/app/api/controller/v1/order/StoreOrderController.php
+++ b/crmeb/app/api/controller/v1/order/StoreOrderController.php
@@ -263,9 +263,6 @@ class StoreOrderController
return app('json')->fail(410215);
}
- //重新生成订单号去支付
-// $order['order_id'] = mt_rand(100, 999) . '_' . $order['order_id'];
-
//0元支付
if (bcsub((string)$orderInfo['pay_price'], '0', 2) <= 0) {
//创建订单jspay支付
@@ -430,6 +427,7 @@ class StoreOrderController
* 订单删除
* @param Request $request
* @return mixed
+ * @throws \Psr\SimpleCache\InvalidArgumentException
*/
public function del(Request $request)
{
diff --git a/crmeb/app/api/controller/v1/store/CategoryController.php b/crmeb/app/api/controller/v1/store/CategoryController.php
index 110c89b30..f8a2ae83a 100644
--- a/crmeb/app/api/controller/v1/store/CategoryController.php
+++ b/crmeb/app/api/controller/v1/store/CategoryController.php
@@ -28,7 +28,11 @@ class CategoryController
/**
* 获取分类列表
+ * @param Request $request
* @return mixed
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function category(Request $request)
{
diff --git a/crmeb/app/api/controller/v1/store/StoreCouponsController.php b/crmeb/app/api/controller/v1/store/StoreCouponsController.php
index 4925e2cfe..234087391 100644
--- a/crmeb/app/api/controller/v1/store/StoreCouponsController.php
+++ b/crmeb/app/api/controller/v1/store/StoreCouponsController.php
@@ -50,6 +50,9 @@ class StoreCouponsController
* 领取优惠券
* @param Request $request
* @return mixed
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function receive(Request $request)
{
@@ -82,6 +85,7 @@ class StoreCouponsController
* @param StoreCouponIssueServices $service
* @param $cartId
* @param $new
+ * @param $shippingType
* @return mixed
* @throws \Psr\SimpleCache\InvalidArgumentException
* @throws \think\db\exception\DataNotFoundException
diff --git a/crmeb/app/api/controller/v1/user/UserRechargeController.php b/crmeb/app/api/controller/v1/user/UserRechargeController.php
index 3c4be9601..68d8283b5 100644
--- a/crmeb/app/api/controller/v1/user/UserRechargeController.php
+++ b/crmeb/app/api/controller/v1/user/UserRechargeController.php
@@ -36,6 +36,9 @@ class UserRechargeController
* 用户充值
* @param Request $request
* @return mixed
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function recharge(Request $request)
{
diff --git a/crmeb/app/api/controller/v2/activity/LuckLotteryController.php b/crmeb/app/api/controller/v2/activity/LuckLotteryController.php
index dde6e1a3f..1623d7568 100644
--- a/crmeb/app/api/controller/v2/activity/LuckLotteryController.php
+++ b/crmeb/app/api/controller/v2/activity/LuckLotteryController.php
@@ -102,7 +102,11 @@ class LuckLotteryController
/**
* 领取奖品
* @param Request $request
+ * @param LuckLotteryRecordServices $lotteryRecordServices
* @return mixed
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function lotteryReceive(Request $request, LuckLotteryRecordServices $lotteryRecordServices)
{
@@ -125,6 +129,9 @@ class LuckLotteryController
* @param Request $request
* @param LuckLotteryRecordServices $lotteryRecordServices
* @return mixed
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function lotteryRecord(Request $request, LuckLotteryRecordServices $lotteryRecordServices)
{
diff --git a/crmeb/app/api/controller/v2/user/UserInvoiceController.php b/crmeb/app/api/controller/v2/user/UserInvoiceController.php
index 574228246..4e87f6f15 100644
--- a/crmeb/app/api/controller/v2/user/UserInvoiceController.php
+++ b/crmeb/app/api/controller/v2/user/UserInvoiceController.php
@@ -142,7 +142,11 @@ class UserInvoiceController
$uid = (int)$request->uid();
$re = $this->services->saveInvoice($uid, $data);
if ($re) {
- return app('json')->success($re['type'] == 'edit' ? 100001 : $re['data']);
+ if ($re['type'] == 'edit') {
+ return app('json')->success(100001);
+ } else {
+ return app('json')->success(100021, $re['data']);
+ }
} else {
return app('json')->fail(100005);
}
diff --git a/crmeb/app/dao/article/ArticleCategoryDao.php b/crmeb/app/dao/article/ArticleCategoryDao.php
index 9abee485c..dfd266a10 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)
{
@@ -82,9 +86,10 @@ class ArticleCategoryDao extends BaseDao
* 添加修改选择上级分类列表
* @param array $where
* @return array
+ * @throws \ReflectionException
*/
public function getMenus(array $where)
{
- return $this->search($where)->order('sort desc,id desc')->column('title,pid,id');
+ return $this->search($where)->order('sort desc,id desc')->column('title,pid,id,is_del,status');
}
}
diff --git a/crmeb/app/dao/order/StoreOrderDao.php b/crmeb/app/dao/order/StoreOrderDao.php
index 7b375e80d..9d63494ca 100644
--- a/crmeb/app/dao/order/StoreOrderDao.php
+++ b/crmeb/app/dao/order/StoreOrderDao.php
@@ -497,7 +497,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')
@@ -513,7 +513,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')
@@ -896,7 +896,7 @@ class StoreOrderDao extends BaseDao
*/
public function seckillPeople($id, $keyword, $page = 0, $limit = 0)
{
- return $this->getModel()
+ return $this->getModel()->where('paid', 1)->whereIn('refund_type', [0, 3])->where('is_del', 0)
->when($id != 0, function ($query) use ($id) {
$query->where('seckill_id', $id);
})->when($keyword != '', function ($query) use ($keyword) {
@@ -904,6 +904,7 @@ class StoreOrderDao extends BaseDao
})->where('paid', 1)->field([
'real_name',
'uid',
+ 'user_phone',
'SUM(total_num) as goods_num',
'COUNT(id) as order_num',
'SUM(pay_price) as total_price',
diff --git a/crmeb/app/dao/user/UserBrokerageDao.php b/crmeb/app/dao/user/UserBrokerageDao.php
index 54d688d2c..224677302 100644
--- a/crmeb/app/dao/user/UserBrokerageDao.php
+++ b/crmeb/app/dao/user/UserBrokerageDao.php
@@ -33,6 +33,10 @@ class UserBrokerageDao extends BaseDao
* @param int $limit
* @param array $typeWhere
* @return array
+ * @throws \ReflectionException
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function getList(array $where, string $field = '*', int $page = 0, int $limit = 0, array $typeWhere = [])
{
@@ -68,7 +72,8 @@ class UserBrokerageDao extends BaseDao
*/
public function brokerageRankList(array $where, int $page = 0, int $limit = 0)
{
- return $this->search($where)->field('uid,SUM(IF(pm=1,`number`,-`number`)) as brokerage_price')->with(['user' => function ($query) {
+ //SUM(IF(pm=1,`number`,-`number`))
+ return $this->search($where)->field('uid,SUM(number) as brokerage_price')->with(['user' => function ($query) {
$query->field('uid,avatar,nickname');
}])->order('brokerage_price desc')->group('uid')->when($page && $limit, function ($query) use ($page, $limit) {
$query->page($page, $limit);
@@ -79,6 +84,7 @@ class UserBrokerageDao extends BaseDao
* 获取某些条件的佣金总数
* @param array $where
* @return mixed
+ * @throws \ReflectionException
*/
public function getBrokerageSumColumn(array $where)
{
@@ -92,6 +98,7 @@ class UserBrokerageDao extends BaseDao
* 获取某个账户下的冻结佣金
* @param int $uid
* @return float
+ * @throws \ReflectionException
*/
public function getUserFrozenPrice(int $uid)
{
diff --git a/crmeb/app/dao/user/UserDao.php b/crmeb/app/dao/user/UserDao.php
index 887259c30..715374a5c 100644
--- a/crmeb/app/dao/user/UserDao.php
+++ b/crmeb/app/dao/user/UserDao.php
@@ -82,7 +82,9 @@ class UserDao extends BaseDao
/**
* @param $uid
+ * @param string $field
* @return \think\Collection
+ * @throws \ReflectionException
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
@@ -164,6 +166,7 @@ class UserDao extends BaseDao
->order('count desc')
->order('t0.uid desc')
->where('t1.spread_time', 'BETWEEN', $time)
+ ->where('t0.is_del', 0)
->page($page, $limit)
->group('t0.uid')
->select()->toArray();
diff --git a/crmeb/app/dao/wechat/WechatQrcodeRecordDao.php b/crmeb/app/dao/wechat/WechatQrcodeRecordDao.php
index 87bebcd0e..d2d4f4db5 100644
--- a/crmeb/app/dao/wechat/WechatQrcodeRecordDao.php
+++ b/crmeb/app/dao/wechat/WechatQrcodeRecordDao.php
@@ -44,6 +44,7 @@ class WechatQrcodeRecordDao extends BaseDao
* @param $timeType
* @param $field
* @param $str
+ * @param string $orderStatus
* @return mixed
*/
public function getRecordTrend($qid, $time, $timeType, $field, $str, $orderStatus = '')
diff --git a/crmeb/app/jobs/UnpaidOrderCancelJob.php b/crmeb/app/jobs/UnpaidOrderCancelJob.php
index 81fb32355..6e11539c4 100644
--- a/crmeb/app/jobs/UnpaidOrderCancelJob.php
+++ b/crmeb/app/jobs/UnpaidOrderCancelJob.php
@@ -33,7 +33,7 @@ class UnpaidOrderCancelJob extends BaseJobs
public function doJob($orderId)
{
/** @var StoreOrderServices $services */
- $services = app()->make(StoreOrderServices::class);
+ $services = app()->make(StoreOrderServices::class);
$orderInfo = $services->get($orderId);
if (!$orderInfo) {
return true;
@@ -49,21 +49,21 @@ class UnpaidOrderCancelJob extends BaseJobs
}
/** @var StoreOrderCartInfoServices $cartServices */
$cartServices = app()->make(StoreOrderCartInfoServices::class);
- $cartInfo = $cartServices->getOrderCartInfo($orderId);
+ $cartInfo = $cartServices->getOrderCartInfo($orderId);
/** @var StoreOrderRefundServices $refundServices */
$refundServices = app()->make(StoreOrderRefundServices::class);
try {
$res = $refundServices->transaction(function () use ($orderInfo, $refundServices) {
//回退积分和优惠卷
- $refundServices->integralAndCouponBack($orderInfo);
+ $refundServices->integralAndCouponBack($orderInfo, 'cancel');
//回退库存和销量
$refundServices->regressionStock($orderInfo);
return true;
});
if ($res) {
$orderInfo->is_del = 1;
- $orderInfo->mark = '订单未支付已超过系统预设时间';
+ $orderInfo->mark = '订单未支付已超过系统预设时间';
$orderInfo->save();
}
return $res;
diff --git a/crmeb/app/listener/notice/NoticeListener.php b/crmeb/app/listener/notice/NoticeListener.php
index 5d3618b22..1b425b8b6 100644
--- a/crmeb/app/listener/notice/NoticeListener.php
+++ b/crmeb/app/listener/notice/NoticeListener.php
@@ -70,6 +70,7 @@ class NoticeListener implements ListenerInterface
case 'bind_spread_uid':
if (isset($data['spreadUid']) && $data['spreadUid']) {
$name = $data['nickname'] ?? '';
+ crmebLog('绑定推广关系');
//站内信
$SystemMsg->sendMsg($data['spreadUid'], ['nickname' => $name]);
//模板消息公众号模版消息
@@ -354,7 +355,7 @@ class NoticeListener implements ListenerInterface
$link = '/pages/admin/orderDetail/index?id=' . $order['order_id'];
$WechatTemplateList->sendAdminOrder($order['order_id'], $storeName, $title, $status, $link);
//企业微信通知
- EnterpriseWechatJob::dispatch([['order_id' => $order['order_id']]]);
+ $EnterpriseWechat->weComSend(['order_id' => $order['order_id']]);
break;
//确认收货给客服
case 'send_admin_confirm_take_over':
@@ -371,7 +372,7 @@ class NoticeListener implements ListenerInterface
$link = '/pages/admin/orderDetail/index?id=' . $order['order_id'];
$WechatTemplateList->sendAdminOrder($order['order_id'], $storeName, $title, $status, $link);
//企业微信通知
- EnterpriseWechatJob::dispatch([['storeTitle' => $storeTitle, 'order_id' => $order['order_id']]]);
+ $EnterpriseWechat->weComSend(['storeTitle' => $storeTitle, 'order_id' => $order['order_id']]);
break;
//申请退款给客服发消息
case 'send_order_apply_refund':
@@ -381,7 +382,7 @@ class NoticeListener implements ListenerInterface
//短信
$NoticeSms->sendAdminRefund($order);
//企业微信通知
- EnterpriseWechatJob::dispatch([['order_id' => $order['order_id']]]);
+ $EnterpriseWechat->weComSend(['order_id' => $order['order_id']]);
//公众号
$storeName = $orderInfoServices->getCarIdByProductTitle((int)$order['id']);
$title = '亲,您有个退款订单待处理!';
@@ -394,7 +395,7 @@ class NoticeListener implements ListenerInterface
//站内信
$SystemMsg->kefuSystemSend($data);
//企业微信通知
- EnterpriseWechatJob::dispatch([$data]);
+ $EnterpriseWechat->weComSend($data);
break;
}
diff --git a/crmeb/app/listener/order/OrderPaySuccessListener.php b/crmeb/app/listener/order/OrderPaySuccessListener.php
index ef93256a8..6767cb2ce 100644
--- a/crmeb/app/listener/order/OrderPaySuccessListener.php
+++ b/crmeb/app/listener/order/OrderPaySuccessListener.php
@@ -46,10 +46,12 @@ class OrderPaySuccessListener implements ListenerInterface
'change_time' => time()
]);
- //赠送购买商品优惠券
- /** @var StoreProductCouponServices $storeProductCouponServices */
- $storeProductCouponServices = app()->make(StoreProductCouponServices::class);
- $storeProductCouponServices->giveOrderProductCoupon((int)$orderInfo['uid'], $orderInfo['id']);
+ //赠送购买商品优惠券,仅普通商品订单才会赠送
+ if (!$orderInfo['seckill_id'] && !$orderInfo['bargain_id'] && !$orderInfo['combination_id']) {
+ /** @var StoreProductCouponServices $storeProductCouponServices */
+ $storeProductCouponServices = app()->make(StoreProductCouponServices::class);
+ $storeProductCouponServices->giveOrderProductCoupon((int)$orderInfo['uid'], $orderInfo['id']);
+ }
//修改开票数据支付状态
$orderInvoiceServices = app()->make(StoreOrderInvoiceServices::class);
diff --git a/crmeb/app/model/system/store/SystemStore.php b/crmeb/app/model/system/store/SystemStore.php
index 649adf618..9fc53ab34 100644
--- a/crmeb/app/model/system/store/SystemStore.php
+++ b/crmeb/app/model/system/store/SystemStore.php
@@ -78,6 +78,4 @@ class SystemStore extends BaseModel
$query->where('id|name|introduction|phone', 'LIKE', "%$value%");
}
}
-
-
}
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/model/user/User.php b/crmeb/app/model/user/User.php
index a7d4e99d4..4cfb748d5 100644
--- a/crmeb/app/model/user/User.php
+++ b/crmeb/app/model/user/User.php
@@ -440,4 +440,14 @@ class User extends BaseModel
{
if ($value !== '') $query->where('is_del', $value);
}
+
+ /**
+ * 不等于uid搜索器
+ * @param $query
+ * @param $value
+ */
+ public function searchNotUidAttr($query, $value)
+ {
+ if ($value !== '') $query->where('uid', '<>', $value);
+ }
}
diff --git a/crmeb/app/model/wechat/WechatQrcode.php b/crmeb/app/model/wechat/WechatQrcode.php
index 77e60cdd5..62a6de49d 100644
--- a/crmeb/app/model/wechat/WechatQrcode.php
+++ b/crmeb/app/model/wechat/WechatQrcode.php
@@ -59,7 +59,7 @@ class WechatQrcode extends BaseModel
public function searchNameAttr($query, $value)
{
- if ($value != '') $query->where('name', $value);
+ if ($value != '') $query->whereLike('name', '%' . $value . '%');
}
public function searchIsDelAttr($query, $value)
diff --git a/crmeb/app/services/activity/coupon/StoreCouponIssueServices.php b/crmeb/app/services/activity/coupon/StoreCouponIssueServices.php
index 0d6718540..269a45384 100644
--- a/crmeb/app/services/activity/coupon/StoreCouponIssueServices.php
+++ b/crmeb/app/services/activity/coupon/StoreCouponIssueServices.php
@@ -123,6 +123,12 @@ class StoreCouponIssueServices extends BaseServices
$data['is_permanent'] = 1;
$data['total_count'] = 0;
}
+
+ if ($data['is_permanent'] != 1 && $data['receive_limit'] > $data['total_count']) {
+ throw new AdminException(500031);
+ }
+
+
$data['add_time'] = time();
$res = $this->dao->save($data);
if (($data['product_id'] !== '' || $data['category_id'] !== '') && $res) {
@@ -259,7 +265,7 @@ class StoreCouponIssueServices extends BaseServices
$data['add_time'] = $item['start_use_time'];
$data['end_time'] = $item['end_use_time'];
}
- $data['type'] = 'get';
+ $data['type'] = 'send';
$issue['uid'] = $uid;
$issue['issue_coupon_id'] = $item['id'];
$issue['add_time'] = $time;
@@ -359,30 +365,13 @@ class StoreCouponIssueServices extends BaseServices
$issueCouponInfo = $this->dao->getInfo((int)$id);
$uid = $user->uid;
if (!$issueCouponInfo) throw new ApiException(400516);
- /** @var MemberRightServices $memberRightService */
- $memberRightService = app()->make(MemberRightServices::class);
- if ($issueCouponInfo->receive_type == 4 && (!$user->is_money_level || !$memberRightService->getMemberRightStatus("coupon"))) {
- if (!$user->is_money_level) throw new ApiException(400097);
- if (!$memberRightService->getMemberRightStatus("coupon")) throw new ApiException(400098);
- }
/** @var StoreCouponIssueUserServices $issueUserService */
$issueUserService = app()->make(StoreCouponIssueUserServices::class);
- if ($is_receive) {
- $alreadyReceived = $issueUserService->count(['uid' => $uid, 'issue_coupon_id' => $id]);
- if ($alreadyReceived >= $issueCouponInfo['receive_limit']) {
- throw new ApiException(400518);
- }
- }
/** @var StoreCouponUserServices $couponUserService */
$couponUserService = app()->make(StoreCouponUserServices::class);
- if ($issueCouponInfo->remain_count <= 0 && !$issueCouponInfo->is_permanent) throw new ApiException(400518);
$this->transaction(function () use ($issueUserService, $uid, $id, $couponUserService, $issueCouponInfo) {
$issueUserService->save(['uid' => $uid, 'issue_coupon_id' => $id, 'add_time' => time()]);
- $couponUserService->addUserCoupon($uid, $issueCouponInfo, "get");
- if ($issueCouponInfo['total_count'] > 0) {
- $issueCouponInfo['remain_count'] -= 1;
- $issueCouponInfo->save();
- }
+ $couponUserService->addUserCoupon($uid, $issueCouponInfo, "send");
});
}
@@ -423,6 +412,9 @@ class StoreCouponIssueServices extends BaseServices
* @param int $uid
* @param $types
* @return array
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function getUserCouponList(int $uid, $types)
{
@@ -506,6 +498,9 @@ class StoreCouponIssueServices extends BaseServices
* 获取单个优惠券类型
* @param array $where
* @return mixed
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function getOne(array $where)
{
@@ -532,6 +527,8 @@ class StoreCouponIssueServices extends BaseServices
/**
* 给会员发放优惠券
* @param $uid
+ * @param int $couponId
+ * @return bool
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
diff --git a/crmeb/app/services/activity/coupon/StoreCouponUserServices.php b/crmeb/app/services/activity/coupon/StoreCouponUserServices.php
index 1bd6b2353..cb84ac6fb 100644
--- a/crmeb/app/services/activity/coupon/StoreCouponUserServices.php
+++ b/crmeb/app/services/activity/coupon/StoreCouponUserServices.php
@@ -170,6 +170,8 @@ class StoreCouponUserServices extends BaseServices
$coupon['start_time'] = $coupon['start_time'] ? date('Y/m/d', $coupon['start_time']) : date('Y/m/d', $coupon['add_time']);
$coupon['add_time'] = date('Y/m/d', $coupon['add_time']);
$coupon['end_time'] = date('Y/m/d', $coupon['end_time']);
+ $coupon['start_use_time'] = $coupon['start_use_time'] > 0 ? date('Y/m/d', $coupon['start_use_time']) : 0;
+ $coupon['end_use_time'] = $coupon['start_use_time'] > 0 ? date('Y/m/d', $coupon['end_use_time']) : 0;
$coupon['title'] = $coupon['coupon_title'];
$coupon['type'] = $coupon['applicable_type'];
$coupon['use_min_price'] = floatval($coupon['use_min_price']);
diff --git a/crmeb/app/services/activity/coupon/StoreCouponUserUserServices.php b/crmeb/app/services/activity/coupon/StoreCouponUserUserServices.php
index 5e856b673..50b35a3ae 100644
--- a/crmeb/app/services/activity/coupon/StoreCouponUserUserServices.php
+++ b/crmeb/app/services/activity/coupon/StoreCouponUserUserServices.php
@@ -45,7 +45,7 @@ class StoreCouponUserUserServices extends BaseServices
[$page, $limit] = $this->getPageValue();
$list = $this->dao->sysPage($where, $page, $limit);
foreach ($list as $k => &$v) {
- $v['start_time'] = $v['add_time'];
+ $v['start_time'] = $v['start_time'] > 0 ? $v['start_time'] : $v['add_time'];
if ($v['end_time'] < time() || $v['use_time'] != 0) $v['is_fail'] = 1;
}
$count = $this->dao->sysCount($where);
diff --git a/crmeb/app/services/activity/integral/StoreIntegralOrderServices.php b/crmeb/app/services/activity/integral/StoreIntegralOrderServices.php
index 383aa4845..c36a1b39f 100644
--- a/crmeb/app/services/activity/integral/StoreIntegralOrderServices.php
+++ b/crmeb/app/services/activity/integral/StoreIntegralOrderServices.php
@@ -725,12 +725,15 @@ class StoreIntegralOrderServices extends BaseServices
* @param int $id
* @param string $remark
* @return mixed
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function remark(int $id, string $remark)
{
if (!$remark) throw new AdminException(400106);
if (!$id) throw new AdminException(100100);
- if (!$order = $this->services->get($id)) {
+ if (!$order = $this->dao->get($id)) {
throw new AdminException(100025);
}
diff --git a/crmeb/app/services/activity/live/LiveAnchorServices.php b/crmeb/app/services/activity/live/LiveAnchorServices.php
index b360ab7cd..304f56c3e 100644
--- a/crmeb/app/services/activity/live/LiveAnchorServices.php
+++ b/crmeb/app/services/activity/live/LiveAnchorServices.php
@@ -92,10 +92,13 @@ class LiveAnchorServices extends BaseServices
* @param int $id
* @param array $data
* @return mixed
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function save(int $id, array $data)
{
- $liveAnchor = $this->dao->get(['wechat' => $data['wechat']]);
+ $liveAnchor = $this->dao->get(['wechat' => $data['wechat'], 'is_del' => 0]);
if (!MiniProgramService::getRoleList(2, 0, 30, $data['wechat'])) {
throw new AdminException(400426);
}
diff --git a/crmeb/app/services/activity/live/LiveRoomServices.php b/crmeb/app/services/activity/live/LiveRoomServices.php
index 4408c8647..a5f03b14a 100644
--- a/crmeb/app/services/activity/live/LiveRoomServices.php
+++ b/crmeb/app/services/activity/live/LiveRoomServices.php
@@ -40,6 +40,10 @@ class LiveRoomServices extends BaseServices
$where['is_del'] = 0;
[$page, $limit] = $this->getPageValue();
$list = $this->dao->getList($where, '*', [], $page, $limit);
+ $liveProductServices = app()->make(LiveRoomGoodsServices::class);
+ foreach ($list as &$item) {
+ $item['product_ids'] = array_column($liveProductServices->selectList(['live_room_id' => $item['id']])->toArray(), 'live_goods_id');
+ }
$count = $this->dao->count($where);
return compact('count', 'list');
}
diff --git a/crmeb/app/services/activity/lottery/LuckLotteryRecordServices.php b/crmeb/app/services/activity/lottery/LuckLotteryRecordServices.php
index 28cd0ad82..3f4d9ac1e 100644
--- a/crmeb/app/services/activity/lottery/LuckLotteryRecordServices.php
+++ b/crmeb/app/services/activity/lottery/LuckLotteryRecordServices.php
@@ -46,6 +46,9 @@ class LuckLotteryRecordServices 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)
{
@@ -108,7 +111,11 @@ class LuckLotteryRecordServices extends BaseServices
* 写入中奖纪录
* @param int $uid
* @param array $prize
+ * @param array $userInfo
* @return mixed
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function insertPrizeRecord(int $uid, array $prize, array $userInfo = [])
{
@@ -218,13 +225,6 @@ class LuckLotteryRecordServices extends BaseServices
throw new ApiException(410053);
}
break;
- case 7:
- //TODO 未完善
- break;
- case 8:
- break;
- case 9:
- break;
}
$this->dao->update($lottery_record_id, $data, 'id');
});
@@ -272,7 +272,11 @@ class LuckLotteryRecordServices extends BaseServices
/**
* 获取中奖记录
* @param int $uid
+ * @param array $where
* @return array
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function getRecord(int $uid, $where = [])
{
diff --git a/crmeb/app/services/activity/lottery/LuckLotteryServices.php b/crmeb/app/services/activity/lottery/LuckLotteryServices.php
index a22107895..a5114ede3 100644
--- a/crmeb/app/services/activity/lottery/LuckLotteryServices.php
+++ b/crmeb/app/services/activity/lottery/LuckLotteryServices.php
@@ -154,7 +154,6 @@ class LuckLotteryServices extends BaseServices
}
$lottery = $lottery->toArray();
if (isset($lottery['prize']) && $lottery['prize']) {
- $products = $coupons = [];
$product_ids = array_unique(array_column($lottery['prize'], 'product_id'));
$coupon_ids = array_unique(array_column($lottery['prize'], 'coupon_id'));
/** @var StoreProductServices $productServices */
@@ -173,6 +172,9 @@ class LuckLotteryServices extends BaseServices
}
}
}
+ foreach ($lottery['user_level'] as &$item) {
+ $item = (int)$item;
+ }
/** @var UserLabelServices $userLabelServices */
$userLabelServices = app()->make(UserLabelServices::class);
$lottery['user_label'] = !empty($lottery['user_label']) ? $userLabelServices->getLabelList(['ids' => $lottery['user_label']], ['id', 'label_name']) : [];
@@ -183,6 +185,9 @@ class LuckLotteryServices extends BaseServices
* 添加抽奖活动以及奖品
* @param array $data
* @return mixed
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function add(array $data)
{
@@ -400,6 +405,11 @@ class LuckLotteryServices extends BaseServices
* 抽奖
* @param int $uid
* @param int $lottery_id
+ * @return mixed
+ * @throws \Psr\SimpleCache\InvalidArgumentException
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function luckLottery(int $uid, int $lottery_id)
{
diff --git a/crmeb/app/services/activity/seckill/StoreSeckillServices.php b/crmeb/app/services/activity/seckill/StoreSeckillServices.php
index 9bb2687b0..1bcf9c782 100644
--- a/crmeb/app/services/activity/seckill/StoreSeckillServices.php
+++ b/crmeb/app/services/activity/seckill/StoreSeckillServices.php
@@ -362,7 +362,7 @@ class StoreSeckillServices extends BaseServices
$header[] = ['title' => $item['value'], 'key' => 'value' . ($key + 1), 'align' => 'center', 'minWidth' => 80];
}
$header[] = ['title' => '图片', 'slot' => 'pic', 'align' => 'center', 'minWidth' => 120];
- $header[] = ['title' => '秒杀价', 'slot' => 'price', 'align' => 'center', 'minWidth' => 80];
+ $header[] = ['title' => '秒杀价', 'type' => 1, 'key' => 'price', 'align' => 'center', 'minWidth' => 80];
$header[] = ['title' => '成本价', 'key' => 'cost', 'align' => 'center', 'minWidth' => 80];
$header[] = ['title' => '原价', 'key' => 'ot_price', 'align' => 'center', 'minWidth' => 80];
$header[] = ['title' => '库存', 'key' => 'stock', 'align' => 'center', 'minWidth' => 80];
@@ -716,6 +716,9 @@ class StoreSeckillServices extends BaseServices
* @param $id
* @param string $field
* @return array|false|\PDOStatement|string|\think\Model
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function getValidProduct($id, $field = '*')
{
@@ -724,15 +727,19 @@ class StoreSeckillServices extends BaseServices
/**
* 秒杀统计
+ * @param $id
* @return array
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function seckillStatistics($id)
{
/** @var StoreOrderServices $orderServices */
$orderServices = app()->make(StoreOrderServices::class);
- $pay_count = $orderServices->getDistinctCount([['seckill_id', '=', $id], ['paid', '=', 1]], 'uid', false);
- $order_count = $orderServices->getDistinctCount([['seckill_id', '=', $id]], 'uid', false);
- $all_price = $orderServices->sum([['seckill_id', '=', $id], ['refund_type', 'in', [0, 3]]], 'pay_price');
+ $pay_count = $orderServices->getDistinctCount([['seckill_id', '=', $id], ['paid', '=', 1], ['refund_type', 'in', [0, 3]]], 'uid', false);
+ $order_count = $orderServices->getDistinctCount([['seckill_id', '=', $id], ['refund_type', 'in', [0, 3]]], 'uid', false);
+ $all_price = $orderServices->sum([['seckill_id', '=', $id], ['refund_type', 'in', [0, 3]], ['paid', '=', 1]], 'pay_price');
$seckillInfo = $this->dao->get($id);
$pay_rate = $seckillInfo['quota'] . '/' . $seckillInfo['quota_show'];
return compact('pay_count', 'order_count', 'all_price', 'pay_rate');
@@ -768,6 +775,7 @@ class StoreSeckillServices extends BaseServices
/** @var StoreOrderServices $orderServices */
$orderServices = app()->make(StoreOrderServices::class);
[$page, $limit] = $this->getPageValue();
+ $where['is_del'] = 0;
$list = $orderServices->seckillOrder($id, $where, $page, $limit);
$where['seckill_id'] = $id;
$count = $orderServices->count($where);
diff --git a/crmeb/app/services/article/ArticleCategoryServices.php b/crmeb/app/services/article/ArticleCategoryServices.php
index 6b11513f4..aff354ae6 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');
@@ -160,10 +151,10 @@ class ArticleCategoryServices extends BaseServices
/**
* 树形列表
* @return array
+ * @throws \ReflectionException
*/
public function getTreeList()
{
- $where['is_show'] = 1;
- return sort_list_tier($this->dao->getMenus($where));
+ return sort_list_tier($this->dao->getMenus([]));
}
}
diff --git a/crmeb/app/services/order/OutStoreOrderServices.php b/crmeb/app/services/order/OutStoreOrderServices.php
index a556cdbe5..886dd3fbd 100644
--- a/crmeb/app/services/order/OutStoreOrderServices.php
+++ b/crmeb/app/services/order/OutStoreOrderServices.php
@@ -225,7 +225,7 @@ class OutStoreOrderServices extends BaseServices
* @param array $list
* @return array
*/
- public function tidyCartList(array $cartInfo, array $list, int $cartId = 0): array
+ public function tidyCartList(array $cartInfo, array $list, $cartId = 0): array
{
$list[] = [
'cart_id' => $cartId,
diff --git a/crmeb/app/services/order/StoreCartServices.php b/crmeb/app/services/order/StoreCartServices.php
index ededd6887..34275c1da 100644
--- a/crmeb/app/services/order/StoreCartServices.php
+++ b/crmeb/app/services/order/StoreCartServices.php
@@ -232,8 +232,10 @@ class StoreCartServices extends BaseServices
public function setCart(int $uid, int $product_id, int $cart_num = 1, string $product_attr_unique = '', int $type = 0, bool $new = true, int $combination_id = 0, int $seckill_id = 0, int $bargain_id = 0, int $advance_id = 0)
{
if ($cart_num < 1) $cart_num = 1;
- //检查限购
- $this->checkLimit($uid, $product_id, $cart_num, $new);
+ if ($type == 0) {
+ //检查限购
+ $this->checkLimit($uid, $product_id, $cart_num, $new);
+ }
//检测库存限量
[$attrInfo, $product_attr_unique, $bargainPriceMin, $cart_num, $productInfo] = $this->checkProductStock($uid, $cart_num, $product_attr_unique, $type, $product_id, $seckill_id, $bargain_id, $combination_id, $advance_id);
if ($new) {
@@ -432,8 +434,10 @@ class StoreCartServices extends BaseServices
*/
public function setCartNum($uid, $productId, $num, $unique, $type)
{
- //检查限购
- $this->checkLimit($uid, $productId, $num, 0);
+ if ($type == 1) {
+ //检查限购
+ $this->checkLimit($uid, $productId, $num, 0);
+ }
/** @var StoreProductAttrValueServices $attrValueServices */
$attrValueServices = app()->make(StoreProductAttrValueServices::class);
@@ -677,6 +681,7 @@ class StoreCartServices extends BaseServices
* @param $num
* @param $new
* @return bool
+ * @throws \ReflectionException
*/
public function checkLimit($uid, $product_id, $num, $new)
{
@@ -699,8 +704,8 @@ class StoreCartServices extends BaseServices
}
} else if ($limitInfo['limit_type'] == 2) {
$cartNum = $this->dao->sum(['uid' => $uid, 'product_id' => $product_id], 'cart_num');
- $orderPayNum = $orderCartServices->sum(['uid' => $uid, 'product_id' => $product_id], 'cart_num');
- $orderRefundNum = $orderCartServices->sum(['uid' => $uid, 'product_id' => $product_id], 'refund_num');
+ $orderPayNum = $orderCartServices->sum(['uid' => $uid, 'product_id' => $product_id, 'split_status' => 0], 'cart_num');
+ $orderRefundNum = $orderCartServices->sum(['uid' => $uid, 'product_id' => $product_id, 'split_status' => 0], 'refund_num');
$orderNum = $orderPayNum - $orderRefundNum;
if (($num + $orderNum + $cartNum) > $limitInfo['limit_num']) {
throw new ApiException(410240, ['limit' => $limitInfo['limit_num'], 'pay_num' => $orderNum]);
diff --git a/crmeb/app/services/order/StoreOrderCreateServices.php b/crmeb/app/services/order/StoreOrderCreateServices.php
index 8686d5f38..f10d15c2e 100644
--- a/crmeb/app/services/order/StoreOrderCreateServices.php
+++ b/crmeb/app/services/order/StoreOrderCreateServices.php
@@ -798,7 +798,7 @@ class StoreOrderCreateServices extends BaseServices
//计算商品金额
if (sys_config('user_brokerage_type') == 1) {
//按照实际支付价格返佣
- $price = bcmul((string)$cart['truePrice'], $cartNum, 4);
+ $price = bcmul((string)bcadd((string)$cart['truePrice'], (string)$cart['postage_price'], 2), $cartNum, 4);
} else {
//按照商品价格返佣
if (isset($productInfo['attrInfo'])) {
diff --git a/crmeb/app/services/order/StoreOrderDeliveryServices.php b/crmeb/app/services/order/StoreOrderDeliveryServices.php
index 180bd280b..5d6409161 100644
--- a/crmeb/app/services/order/StoreOrderDeliveryServices.php
+++ b/crmeb/app/services/order/StoreOrderDeliveryServices.php
@@ -569,6 +569,7 @@ class StoreOrderDeliveryServices extends BaseServices
/**
* 虚拟商品自动发货
* @param $orderInfo
+ * @throws \ReflectionException
*/
public function virtualSend($orderInfo)
{
diff --git a/crmeb/app/services/order/StoreOrderInvoiceServices.php b/crmeb/app/services/order/StoreOrderInvoiceServices.php
index 0ea780c78..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)
{
@@ -155,7 +162,9 @@ class StoreOrderInvoiceServices extends BaseServices
if (!$orderInvoice) {
throw new ApiException(100026);
}
- $data['invoice_time'] = time();
+ if ($data['is_invoice'] == 1) {
+ $data['invoice_time'] = time();
+ }
if (!$this->dao->update($id, $data, 'id')) {
throw new ApiException(100015);
}
diff --git a/crmeb/app/services/order/StoreOrderRefundServices.php b/crmeb/app/services/order/StoreOrderRefundServices.php
index d850b6cb8..b0926ab9c 100644
--- a/crmeb/app/services/order/StoreOrderRefundServices.php
+++ b/crmeb/app/services/order/StoreOrderRefundServices.php
@@ -426,18 +426,19 @@ class StoreOrderRefundServices extends BaseServices
/**
* 回退积分和优惠卷
* @param $order
+ * @param string $type
* @return bool
*/
- public function integralAndCouponBack($order)
+ public function integralAndCouponBack($order, $type = 'refund')
{
/** @var StoreOrderStatusServices $statusService */
$statusService = app()->make(StoreOrderStatusServices::class);
$res = true;
- //回退优惠卷 拆分子订单不退优惠券
- if (!$order['pid'] && $order['coupon_id'] && $order['coupon_price']) {
- /** @var StoreCouponUserServices $coumonUserServices */
- $coumonUserServices = app()->make(StoreCouponUserServices::class);
- $res = $res && $coumonUserServices->recoverCoupon((int)$order['coupon_id']);
+ //取消的订单退回优惠券
+ if ($type == 'cancel' && $order['coupon_id'] && $order['coupon_price']) {
+ /** @var StoreCouponUserServices $couponUserServices */
+ $couponUserServices = app()->make(StoreCouponUserServices::class);
+ $res = $couponUserServices->recoverCoupon((int)$order['coupon_id']);
$statusService->save([
'oid' => $order['id'],
'change_type' => 'coupon_back',
@@ -1064,7 +1065,7 @@ class StoreOrderRefundServices extends BaseServices
if ($list) {
foreach ($list as &$item) {
$item['paid'] = 1;
- $item['add_time'] = $item['_add_time'] = isset($item['add_time']) ? date('Y-m-d H:i', (int)$item['add_time']) : '';
+ $item['add_time'] = $item['_add_time'] = isset($item['add_time']) ? date('Y-m-d H:i:s', (int)$item['add_time']) : '';
$item['cartInfo'] = $item['cart_info'];
if (in_array($item['refund_type'], [1, 2, 4, 5])) {
$item['refund_status'] = 1;
diff --git a/crmeb/app/services/order/StoreOrderServices.php b/crmeb/app/services/order/StoreOrderServices.php
index 1d653a599..2872f002c 100644
--- a/crmeb/app/services/order/StoreOrderServices.php
+++ b/crmeb/app/services/order/StoreOrderServices.php
@@ -82,6 +82,8 @@ class StoreOrderServices extends BaseServices
/**
* 获取列表
* @param array $where
+ * @param array $field
+ * @param array $with
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
@@ -1855,9 +1857,10 @@ HTML;
/**
* 删除订单
- * @param $uni
- * @param $uid
+ * @param string $uni
+ * @param int $uid
* @return bool
+ * @throws \Psr\SimpleCache\InvalidArgumentException
*/
public function removeOrder(string $uni, int $uid)
{
@@ -1879,21 +1882,6 @@ HTML;
'change_time' => time()
]);
if ($order->save() && $res) {
- //未支付和已退款的状态下才可以退积分退库存退优惠券
- if ($order['_status']['_type'] == 0 || $order['_status']['_type'] == -2) {
- /** @var StoreOrderRefundServices $refundServices */
- $refundServices = app()->make(StoreOrderRefundServices::class);
- $this->transaction(function () use ($order, $refundServices) {
- //回退积分和优惠卷
- $res = $refundServices->integralAndCouponBack($order);
- //回退库存
- $res = $res && $refundServices->regressionStock($order);
- if (!$res) {
- throw new ApiException(100020);
- }
- });
-
- }
return true;
} else
throw new ApiException(100020);
@@ -1924,7 +1912,7 @@ HTML;
$refundServices = app()->make(StoreOrderRefundServices::class);
$this->transaction(function () use ($refundServices, $order) {
- $res = $refundServices->integralAndCouponBack($order) && $refundServices->regressionStock($order);
+ $res = $refundServices->integralAndCouponBack($order, 'cancel') && $refundServices->regressionStock($order);
$order->is_del = 1;
if (!($res && $order->save())) {
throw new ApiException(100020);
@@ -2136,7 +2124,7 @@ HTML;
try {
$this->transaction(function () use ($order, $refundServices) {
//回退积分和优惠卷
- $res = $refundServices->integralAndCouponBack($order);
+ $res = $refundServices->integralAndCouponBack($order, 'cancel');
//回退库存和销量
$res = $res && $refundServices->regressionStock($order);
//修改订单状态
@@ -2351,6 +2339,7 @@ HTML;
}
}
$data['_status'] = $orderInfo['_status'] ?? [];
+ $data['_status']['_is_back'] = $orderInfo['delivery_type'] != 'fictitious' && $orderInfo['virtual_type'] == 0;
$data['cartInfo'] = $data['cartInfo'] ?? $cartInfo;
return $data;
}
@@ -2649,7 +2638,7 @@ HTML;
$data['pay_price'] = $info['pay_price'];
$data['pay_postage'] = $info['pay_postage'];
- $data['offline_postage'] = sys_config('offline_postage', 0);
+ $data['offline_postage'] = (int)sys_config('offline_postage', 0);
$data['invalid_time'] = $time;
break;
diff --git a/crmeb/app/services/order/StoreOrderSplitServices.php b/crmeb/app/services/order/StoreOrderSplitServices.php
index 8950205d3..e6178ecae 100644
--- a/crmeb/app/services/order/StoreOrderSplitServices.php
+++ b/crmeb/app/services/order/StoreOrderSplitServices.php
@@ -160,6 +160,7 @@ class StoreOrderSplitServices extends BaseServices
'cart_info' => json_encode($_info),
];
}
+ $storeOrderCartInfoServices->update(['oid' => $id, 'cart_id' => $cart['cart_id']], ['surplus_num' => 0, 'split_status' => 2]);
}
if ($orderInfo['pid'] > 0 && $key == 'other') {
diff --git a/crmeb/app/services/other/export/ExportServices.php b/crmeb/app/services/other/export/ExportServices.php
index 3648a37ac..10a4bc281 100644
--- a/crmeb/app/services/other/export/ExportServices.php
+++ b/crmeb/app/services/other/export/ExportServices.php
@@ -306,7 +306,7 @@ class ExportServices extends BaseServices
'ot_price' => $item['ot_price'],
'quota' => $item['quota'],
'start_name' => $item['start_name'],
- 'activity_time' => date('Y-m-d H:i:s', $item['start_time']) . '至' . date('Y-m-d H:i:s', $item['stop_time']),
+ 'activity_time' => date('Y-m-d', $item['start_time']) . '至' . date('Y-m-d', $item['stop_time']),
'add_time' => $item['add_time']
];
$export[] = $one_data;
@@ -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/pay/PayNotifyServices.php b/crmeb/app/services/pay/PayNotifyServices.php
index 3ca880e72..b160463cb 100644
--- a/crmeb/app/services/pay/PayNotifyServices.php
+++ b/crmeb/app/services/pay/PayNotifyServices.php
@@ -26,7 +26,10 @@ class PayNotifyServices
/**
* 订单支付成功之后
* @param string|null $order_id 订单id
+ * @param string|null $trade_no
+ * @param string $payType
* @return bool
+ * @throws \Psr\SimpleCache\InvalidArgumentException
*/
public function wechatProduct(string $order_id = null, string $trade_no = null, string $payType = PayServices::WEIXIN_PAY)
{
diff --git a/crmeb/app/services/pay/PayServices.php b/crmeb/app/services/pay/PayServices.php
index e896d63be..acb83409a 100644
--- a/crmeb/app/services/pay/PayServices.php
+++ b/crmeb/app/services/pay/PayServices.php
@@ -40,6 +40,9 @@ class PayServices
//好友代付
const FRIEND = 'friend';
+ //银行转账
+ const BANK = 'bank';
+
//支付方式
const PAY_TYPE = [
PayServices::WEIXIN_PAY => '微信支付',
@@ -47,7 +50,8 @@ class PayServices
PayServices::OFFLINE_PAY => '线下支付',
PayServices::ALIAPY_PAY => '支付宝',
PayServices::FRIEND => '好友代付',
- PayServices::ALLIN_PAY => '通联支付'
+ PayServices::ALLIN_PAY => '通联支付',
+ PayServices::BANK => '银行转账',
];
/**
diff --git a/crmeb/app/services/product/product/StoreCategoryServices.php b/crmeb/app/services/product/product/StoreCategoryServices.php
index 97ab79f0a..c096dca60 100644
--- a/crmeb/app/services/product/product/StoreCategoryServices.php
+++ b/crmeb/app/services/product/product/StoreCategoryServices.php
@@ -107,17 +107,16 @@ class StoreCategoryServices extends BaseServices
/**
* 设置分类状态
- * @param $id
- * @param $is_show
+ * @param int $id
+ * @param int $is_show
*/
public function setShow(int $id, int $is_show)
{
$res = $this->dao->update($id, ['is_show' => $is_show]);
$res = $res && $this->dao->update($id, ['is_show' => $is_show], 'pid');
+ $this->cacheDriver()->clear();
if (!$res) {
throw new AdminException(100005);
- } else {
- $this->cacheDriver()->clear();
}
}
@@ -184,6 +183,10 @@ class StoreCategoryServices extends BaseServices
/**
* 保存新增数据
* @param $data
+ * @return int
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function createData($data)
{
diff --git a/crmeb/app/services/product/product/StoreProductCouponServices.php b/crmeb/app/services/product/product/StoreProductCouponServices.php
index da8ea57fb..b3362dccb 100644
--- a/crmeb/app/services/product/product/StoreProductCouponServices.php
+++ b/crmeb/app/services/product/product/StoreProductCouponServices.php
@@ -92,6 +92,9 @@ class StoreProductCouponServices extends BaseServices
* @param int $uid
* @param $orderId
* @return array
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function giveOrderProductCoupon(int $uid, $orderId)
{
diff --git a/crmeb/app/services/product/product/StoreProductServices.php b/crmeb/app/services/product/product/StoreProductServices.php
index 1de8d206b..5fca857c7 100644
--- a/crmeb/app/services/product/product/StoreProductServices.php
+++ b/crmeb/app/services/product/product/StoreProductServices.php
@@ -950,7 +950,7 @@ class StoreProductServices extends BaseServices
}
$header[] = ['title' => '图片', 'slot' => 'pic', 'align' => 'center', 'minWidth' => 120];
if ($type == 1) {
- $header[] = ['title' => '秒杀价', 'slot' => 'price', 'align' => 'center', 'minWidth' => 80];
+ $header[] = ['title' => '秒杀价', 'type' => 1, 'key' => 'price', 'align' => 'center', 'minWidth' => 80];
$header[] = ['title' => '成本价', 'key' => 'cost', 'align' => 'center', 'minWidth' => 80];
$header[] = ['title' => '原价', 'key' => 'ot_price', 'align' => 'center', 'minWidth' => 80];
} elseif ($type == 2) {
@@ -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;
}
@@ -1815,7 +1815,7 @@ class StoreProductServices extends BaseServices
$memberCardService = app()->make(MemberCardServices::class);
$vipStatus = $memberCardService->isOpenMemberCard('vip_price');
foreach ($list as &$item) {
- if (!($vipStatus && $item['is_vip'])) {
+ if (!$this->vipIsOpen(!!$item['is_vip'], $vipStatus)) {
$item['vip_price'] = 0;
}
}
diff --git a/crmeb/app/services/statistic/CapitalFlowServices.php b/crmeb/app/services/statistic/CapitalFlowServices.php
index 09dc0bcd3..0b5877317 100644
--- a/crmeb/app/services/statistic/CapitalFlowServices.php
+++ b/crmeb/app/services/statistic/CapitalFlowServices.php
@@ -104,6 +104,9 @@ class CapitalFlowServices extends BaseServices
* 获取资金流水
* @param $where
* @return array
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function getFlowList($where)
{
diff --git a/crmeb/app/services/user/UserAddressServices.php b/crmeb/app/services/user/UserAddressServices.php
index 9a9fc5914..d6a1d11ef 100644
--- a/crmeb/app/services/user/UserAddressServices.php
+++ b/crmeb/app/services/user/UserAddressServices.php
@@ -82,6 +82,9 @@ class UserAddressServices extends BaseServices
* @param int $uid
* @param string $field
* @return array
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function getUserDefaultAddress(int $uid, string $field = '*')
{
diff --git a/crmeb/app/services/user/UserBrokerageServices.php b/crmeb/app/services/user/UserBrokerageServices.php
index 36e15e6d1..ff4a9bad7 100644
--- a/crmeb/app/services/user/UserBrokerageServices.php
+++ b/crmeb/app/services/user/UserBrokerageServices.php
@@ -187,6 +187,7 @@ class UserBrokerageServices extends BaseServices
* @param array|string[] $type
* @param string $time
* @return float
+ * @throws \ReflectionException
*/
public function getUserBrokerageSum(int $uid, array $type = ['one_brokerage', 'two_brokerage', 'brokerage_user'], $time = '')
{
@@ -271,7 +272,7 @@ class UserBrokerageServices extends BaseServices
*/
public function brokerageRankList(string $time = 'week')
{
- $where = [];
+ $where = ['pm' => 1];
if ($time) {
$where['time'] = $time;
}
@@ -296,10 +297,14 @@ class UserBrokerageServices extends BaseServices
* 获取用户排名
* @param int $uid
* @param string $time
+ * @return false|int|string
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function getUserBrokerageRank(int $uid, string $time = 'week')
{
- $where = [];
+ $where = ['pm' => 1];
if ($time) {
$where['time'] = $time;
}
@@ -327,6 +332,9 @@ class UserBrokerageServices extends BaseServices
* 推广数据 昨天的佣金 累计提现金额 当前佣金
* @param int $uid
* @return mixed
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function commission(int $uid)
{
@@ -354,6 +362,7 @@ class UserBrokerageServices extends BaseServices
* @param array $where
* @param int $time
* @return mixed
+ * @throws \ReflectionException
*/
public function getUsersBokerageSum(array $where, $time = 0)
{
@@ -372,6 +381,10 @@ class UserBrokerageServices extends BaseServices
* @param $uid
* @param $type
* @return array
+ * @throws \ReflectionException
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function getBrokerageList($uid, $type)
{
diff --git a/crmeb/app/services/user/UserCancelServices.php b/crmeb/app/services/user/UserCancelServices.php
index 52199ce5c..ad17879ff 100644
--- a/crmeb/app/services/user/UserCancelServices.php
+++ b/crmeb/app/services/user/UserCancelServices.php
@@ -32,6 +32,7 @@ class UserCancelServices extends BaseServices
/** @var WechatUserServices $wechatUserServices */
$wechatUserServices = app()->make(WechatUserServices::class);
$userServices->update($uid, ['is_del' => 1]);
+ $userServices->update(['spread_uid' => $uid], ['spread_uid' => 0, 'spread_time' => 0]);
$wechatUserServices->update(['uid' => $uid], ['is_del' => 1]);
}
diff --git a/crmeb/app/services/user/UserExtractServices.php b/crmeb/app/services/user/UserExtractServices.php
index d8b330c0f..8e847b24c 100644
--- a/crmeb/app/services/user/UserExtractServices.php
+++ b/crmeb/app/services/user/UserExtractServices.php
@@ -148,11 +148,12 @@ class UserExtractServices extends BaseServices
/**
* 通过提现申请
- * @param $id
+ * @param int $id
+ * @param $userExtract
* @return bool
* @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
- * @throws \think\exception\DbException
*/
public function changeSuccess(int $id, $userExtract)
{
@@ -164,11 +165,7 @@ class UserExtractServices extends BaseServices
$userType = $userServices->value(['uid' => $userExtract['uid']], 'user_type');
$nickname = $userServices->value(['uid' => $userExtract['uid']], 'nickname');
$phone = $userServices->value(['uid' => $userExtract['uid']], 'phone');
- event('NoticeListener', [['uid' => $userExtract['uid'], 'userType' => strtolower($userType), 'extractNumber' => $extractNumber, 'nickname' => $nickname], 'user_extract']);
- if (!$this->dao->update($id, ['status' => 1])) {
- throw new AdminException(100007);
- }
switch ($userExtract['extract_type']) {
case 'bank':
$order_id = $userExtract['bank_code'];
@@ -246,6 +243,12 @@ class UserExtractServices extends BaseServices
'nickname' => $insertData['nickname'],
'phone' => $insertData['phone']
], 'extract');
+
+ if (!$this->dao->update($id, ['status' => 1])) {
+ throw new AdminException(100007);
+ }
+ event('NoticeListener', [['uid' => $userExtract['uid'], 'userType' => strtolower($userType), 'extractNumber' => $extractNumber, 'nickname' => $nickname], 'user_extract']);
+
return true;
}
@@ -339,8 +342,10 @@ class UserExtractServices extends BaseServices
/**
* 通过
- * @param $id
+ * @param int $id
* @return mixed
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function adopt(int $id)
{
diff --git a/crmeb/app/services/user/UserLabelRelationServices.php b/crmeb/app/services/user/UserLabelRelationServices.php
index 46f5bc731..faa3629f8 100644
--- a/crmeb/app/services/user/UserLabelRelationServices.php
+++ b/crmeb/app/services/user/UserLabelRelationServices.php
@@ -47,8 +47,10 @@ class UserLabelRelationServices extends BaseServices
/**
* 用户设置标签
- * @param int $uid
+ * @param $uids
* @param array $labels
+ * @return bool
+ * @throws \Exception
*/
public function setUserLable($uids, array $labels)
{
diff --git a/crmeb/app/services/user/UserLabelServices.php b/crmeb/app/services/user/UserLabelServices.php
index 16ed06cd1..a0607b30a 100644
--- a/crmeb/app/services/user/UserLabelServices.php
+++ b/crmeb/app/services/user/UserLabelServices.php
@@ -40,6 +40,9 @@ class UserLabelServices extends BaseServices
* 获取某一本标签
* @param $id
* @return array|\think\Model|null
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function getLable($id)
{
@@ -110,6 +113,9 @@ class UserLabelServices extends BaseServices
* @param int $id
* @param array $data
* @return mixed
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function save(int $id, array $data)
{
@@ -144,8 +150,11 @@ class UserLabelServices extends BaseServices
/**
* 删除
- * @param $id
- * @throws \Exception
+ * @param int $id
+ * @return bool
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function delLabel(int $id)
{
diff --git a/crmeb/app/services/user/UserRechargeServices.php b/crmeb/app/services/user/UserRechargeServices.php
index b6e8dead1..9083d5a1d 100644
--- a/crmeb/app/services/user/UserRechargeServices.php
+++ b/crmeb/app/services/user/UserRechargeServices.php
@@ -104,11 +104,8 @@ class UserRechargeServices extends BaseServices
foreach ($list as &$item) {
switch ($item['recharge_type']) {
- case 'routine':
- $item['_recharge_type'] = '小程序充值';
- break;
case PayServices::WEIXIN_PAY:
- $item['_recharge_type'] = '公众号充值';
+ $item['_recharge_type'] = '微信充值';
break;
case 'system':
$item['_recharge_type'] = '系统充值';
@@ -138,8 +135,8 @@ class UserRechargeServices extends BaseServices
$data = [];
$data['sumPrice'] = $this->getRechargeSum($where, 'price');
$data['sumRefundPrice'] = $this->getRechargeSum($where, 'refund_price');
- $where['recharge_type'] = 'routine';
- $data['sumRoutinePrice'] = $this->getRechargeSum($where, 'price');
+ $where['recharge_type'] = 'alipay';
+ $data['sumAlipayPrice'] = $this->getRechargeSum($where, 'price');
$where['recharge_type'] = 'weixin';
$data['sumWeixinPrice'] = $this->getRechargeSum($where, 'price');
return [
@@ -158,14 +155,14 @@ class UserRechargeServices extends BaseServices
'col' => 6,
],
[
- 'name' => '小程序充值金额',
+ 'name' => '支付宝充值金额',
'field' => '元',
- 'count' => $data['sumRoutinePrice'],
+ 'count' => $data['sumAlipayPrice'],
'className' => 'logo-bitcoin',
'col' => 6,
],
[
- 'name' => '公众号充值金额',
+ 'name' => '微信充值金额',
'field' => '元',
'count' => $data['sumWeixinPrice'],
'className' => 'ios-bicycle',
@@ -174,9 +171,14 @@ class UserRechargeServices extends BaseServices
];
}
- /**退款表单
- * @param $id
- * @return mixed|void
+ /**
+ * 退款表单
+ * @param int $id
+ * @return array
+ * @throws \FormBuilder\Exception\FormBuilderException
+ * @author 吴汐
+ * @email 442384644@qq.com
+ * @date 2023/03/24
*/
public function refund_edit(int $id)
{
@@ -196,15 +198,17 @@ class UserRechargeServices extends BaseServices
$f = array();
$f[] = Form::input('order_id', '退款单号', $UserRecharge->getData('order_id'))->disabled(true);
$f[] = Form::radio('refund_price', '状态', 1)->options([['label' => '本金(扣赠送余额)', 'value' => 1], ['label' => '仅本金', 'value' => 0]]);
-// $f[] = Form::number('refund_price', '退款金额', (float)$UserRecharge->getData('price'))->precision(2)->min(0)->max($UserRecharge->getData('price'));
return create_form('编辑', $f, Url::buildUrl('/finance/recharge/' . $id), 'PUT');
}
/**
* 退款操作
* @param int $id
- * @param $refund_price
+ * @param string $refund_price
* @return mixed
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function refund_update(int $id, string $refund_price)
{
@@ -314,6 +318,9 @@ class UserRechargeServices extends BaseServices
* @param int $uid
* @param $price
* @return bool
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function importNowMoney(int $uid, $price)
{
@@ -340,7 +347,7 @@ class UserRechargeServices extends BaseServices
//写入充值记录
$rechargeInfo = [
'uid' => $uid,
- 'order_id' => $this->getOrderId(),
+ 'order_id' => app()->make(StoreOrderCreateServices::class)->getNewOrderId('cz'),
'recharge_type' => 'balance',
'price' => $price,
'give_price' => 0,
@@ -381,7 +388,15 @@ class UserRechargeServices extends BaseServices
/**
* 申请充值
* @param int $uid
+ * @param $price
+ * @param $recharId
+ * @param $type
+ * @param $from
+ * @param bool $renten
* @return mixed
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function recharge(int $uid, $price, $recharId, $type, $from, bool $renten = false)
{
@@ -437,8 +452,13 @@ class UserRechargeServices extends BaseServices
}
/**
- * //TODO用户充值成功后
+ * 用户充值成功后
* @param $orderId
+ * @param array $other
+ * @return bool
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function rechargeSuccess($orderId, array $other = [])
{
@@ -475,8 +495,12 @@ class UserRechargeServices extends BaseServices
return true;
}
- /**根据查询用户充值金额
+ /**
+ * 根据查询用户充值金额
* @param array $where
+ * @param string $rechargeSumField
+ * @param string $selectType
+ * @param string $group
* @return float|int
*/
public function getRechargeMoneyByWhere(array $where, string $rechargeSumField, string $selectType, string $group = "")
diff --git a/crmeb/app/services/user/UserServices.php b/crmeb/app/services/user/UserServices.php
index 0afeae323..408b5e9f9 100644
--- a/crmeb/app/services/user/UserServices.php
+++ b/crmeb/app/services/user/UserServices.php
@@ -117,6 +117,7 @@ class UserServices extends BaseServices
* @param int $spreadUid
* @param string $userType
* @return User|\think\Model
+ * @throws Exception
*/
public function setUserInfo($user, int $spreadUid = 0, string $userType = 'wechat')
{
@@ -992,9 +993,13 @@ class UserServices extends BaseServices
/**
* 执行赠送会员等级
- * @param int $uid
+ * @param int $id
+ * @param int $level_id
* @return mixed
- * */
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
+ */
public function saveGiveLevel(int $id, int $level_id)
{
if (!$this->getUserInfo($id)) {
@@ -1039,19 +1044,26 @@ class UserServices extends BaseServices
$field[] = Form::input('time_diff', '到期时间', $timeDiff)->style(['width' => '200px'])->readonly(true);
if ($userInfo['is_ever_level'] == 0) {
$field[] = Form::input('day_diff', '剩余天数', $dayDiff)->style(['width' => '200px'])->readonly(true);
+ $field[] = Form::number('days', '增加时长(天)')->precision(0)->style(['width' => '200px'])->required();
}
- $field[] = Form::number('days', '增加时长(天)')->precision(0)->style(['width' => '200px'])->required();
return create_form('赠送付费会员时长', $field, Url::buildUrl('/user/save_give_level_time/' . $id), 'PUT');
}
/**
* 执行赠送付费会员时长
- * @param int $uid
+ * @param int $id
+ * @param int $days
* @return mixed
- * */
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
+ */
public function saveGiveLevelTime(int $id, int $days)
{
$userInfo = $this->getUserInfo($id);
+ if ($userInfo->is_ever_level == 1) {
+ return true;
+ }
if (!$userInfo) {
throw new AdminException(400214);
}
@@ -1117,7 +1129,12 @@ class UserServices extends BaseServices
/**
* 用户详细信息
- * @param $uid
+ * @param int $uid
+ * @param array $userIfno
+ * @return array
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function getUserDetailed(int $uid, $userIfno = [])
{
@@ -1214,6 +1231,9 @@ class UserServices extends BaseServices
* 用户详情
* @param int $uid
* @return array
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
*/
public function read(int $uid)
{
@@ -1222,6 +1242,20 @@ class UserServices extends BaseServices
throw new AdminException(100026);
}
$userInfo['avatar'] = strpos($userInfo['avatar'], 'http') === false ? (sys_config('site_url') . $userInfo['avatar']) : $userInfo['avatar'];
+ $userInfo['overdue_time'] = date('Y-m-d H:i:s', $userInfo['overdue_time']);
+ $userInfo['birthday'] = $userInfo['birthday'] < 0 ? 0 : $userInfo['birthday'];
+ if ($userInfo['addres'] == '') {
+ $defaultAddressInfo = app()->make(UserAddressServices::class)->getUserDefaultAddress($uid);
+ if ($defaultAddressInfo) {
+ $userInfo['addres'] = $defaultAddressInfo['province'] . $defaultAddressInfo['city'] . $defaultAddressInfo['district'] . $defaultAddressInfo['detail'];
+ } else {
+ $userInfo['addres'] = '';
+ }
+ }
+ $userInfo['vip_name'] = app()->make(SystemUserLevelServices::class)->value(['grade' => $userInfo['level']], 'name');
+ $userInfo['group_name'] = app()->make(UserGroupServices::class)->value(['id' => $userInfo['group_id']], 'group_name');
+ $userInfo['spread_uid_nickname'] = $this->dao->value(['uid' => $userInfo['spread_uid']], 'nickname') . '(' . $userInfo['spread_uid'] . ')';
+ $userInfo['label_list'] = implode(',', array_column(app()->make(UserLabelRelationServices::class)->getUserLabelList([$uid]), 'label_name'));
return [
'uid' => $uid,
'userinfo' => $this->getUserDetailed($uid, $userInfo),
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');
diff --git a/crmeb/app/services/wechat/WechatQrcodeCateServices.php b/crmeb/app/services/wechat/WechatQrcodeCateServices.php
index ef46dabaa..306e7d47b 100644
--- a/crmeb/app/services/wechat/WechatQrcodeCateServices.php
+++ b/crmeb/app/services/wechat/WechatQrcodeCateServices.php
@@ -69,6 +69,8 @@ class WechatQrcodeCateServices extends BaseServices
*/
public function delCate($id = 0)
{
+ $count = app()->make(WechatQrcodeServices::class)->count(['cate_id' => $id]);
+ if ($count) throw new AdminException(400454);
if (!$id) throw new AdminException(100100);
$res = $this->dao->update($id, ['is_del' => 1]);
if (!$res) throw new AdminException(100008);
diff --git a/crmeb/app/services/wechat/WechatQrcodeServices.php b/crmeb/app/services/wechat/WechatQrcodeServices.php
index 8e3db0072..4a80dfad1 100644
--- a/crmeb/app/services/wechat/WechatQrcodeServices.php
+++ b/crmeb/app/services/wechat/WechatQrcodeServices.php
@@ -219,7 +219,7 @@ class WechatQrcodeServices extends BaseServices
* @param int $isFollow
* @return mixed
*/
- public function wechatQrcodeRecord($qrcodeInfo, $userInfo, $spreadInfo, $isFollow = 0)
+ public function wechatQrcodeRecord($qrcodeInfo, $userInfo, $spreadInfo, $isFollow = 1)
{
$response = $this->transaction(function () use ($qrcodeInfo, $userInfo, $spreadInfo, $isFollow) {
diff --git a/crmeb/crmeb/services/AliPayService.php b/crmeb/crmeb/services/AliPayService.php
index aab7e43ca..f35311181 100644
--- a/crmeb/crmeb/services/AliPayService.php
+++ b/crmeb/crmeb/services/AliPayService.php
@@ -13,14 +13,12 @@ namespace crmeb\services;
use Alipay\EasySDK\Payment\Wap\Models\AlipayTradeWapPayResponse;
use app\services\pay\PayServices;
-use crmeb\utils\Hook;
use think\facade\Event;
use think\facade\Log;
use think\facade\Route as Url;
use Alipay\EasySDK\Kernel\Config;
use Alipay\EasySDK\Kernel\Factory;
use crmeb\exceptions\PayException;
-use app\services\pay\PayNotifyServices;
use Alipay\EasySDK\Kernel\Util\ResponseChecker;
/**
diff --git a/crmeb/crmeb/services/app/WechatService.php b/crmeb/crmeb/services/app/WechatService.php
index b732f623e..24fad4bbc 100644
--- a/crmeb/crmeb/services/app/WechatService.php
+++ b/crmeb/crmeb/services/app/WechatService.php
@@ -12,12 +12,10 @@
namespace crmeb\services\app;
use app\services\message\wechat\MessageServices;
-use app\services\order\StoreOrderServices;
use app\services\pay\PayServices;
use app\services\wechat\WechatMessageServices;
use app\services\wechat\WechatReplyServices;
use crmeb\exceptions\AdminException;
-use app\services\pay\PayNotifyServices;
use crmeb\exceptions\ApiException;
use crmeb\services\easywechat\Application;
use EasyWeChat\Message\Article;
@@ -33,7 +31,6 @@ use Symfony\Component\HttpFoundation\Request;
use think\facade\Event;
use think\facade\Log;
use think\Response;
-use crmeb\utils\Hook;
use think\facade\Cache;
use crmeb\services\SystemConfigService;
@@ -395,7 +392,7 @@ class WechatService
if ($result->return_code == 'SUCCESS' && $result->result_code != 'FAIL') {
return true;
} else {
- throw new ApiException(410089);
+ throw new ApiException($result->err_code_des ?? 400658);
}
}
diff --git a/crmeb/crmeb/services/pay/storage/AllinPay.php b/crmeb/crmeb/services/pay/storage/AllinPay.php
index b756f3357..04afa521d 100644
--- a/crmeb/crmeb/services/pay/storage/AllinPay.php
+++ b/crmeb/crmeb/services/pay/storage/AllinPay.php
@@ -13,14 +13,11 @@
namespace crmeb\services\pay\storage;
-
-use app\services\pay\PayNotifyServices;
use app\services\pay\PayServices;
use crmeb\exceptions\PayException;
use crmeb\services\pay\BasePay;
use crmeb\services\pay\PayInterface;
use crmeb\services\pay\extend\allinpay\AllinPay as AllinPayService;
-use crmeb\utils\Hook;
use EasyWeChat\Payment\Order;
use think\facade\Event;
diff --git a/crmeb/crmeb/services/pay/storage/V3WechatPay.php b/crmeb/crmeb/services/pay/storage/V3WechatPay.php
index 60d0af760..fa8399ec2 100644
--- a/crmeb/crmeb/services/pay/storage/V3WechatPay.php
+++ b/crmeb/crmeb/services/pay/storage/V3WechatPay.php
@@ -13,18 +13,14 @@
namespace crmeb\services\pay\storage;
-use app\services\pay\PayNotifyServices;
use app\services\pay\PayServices;
-use app\services\wechat\WechatMessageServices;
use crmeb\exceptions\PayException;
use crmeb\services\app\MiniProgramService;
use crmeb\services\easywechat\Application;
use crmeb\services\pay\BasePay;
use crmeb\services\pay\PayInterface;
-use crmeb\utils\Hook;
use EasyWeChat\Payment\Order;
use think\facade\Event;
-use think\facade\Log;
/**
* Class 微信支付v3
@@ -150,7 +146,7 @@ class V3WechatPay extends BasePay implements PayInterface
*/
public function merchantPay(string $openid, string $orderId, string $amount, array $options = [])
{
- $res = $this->instance->v3pay->setType($options['type'])->batches(
+ return $this->instance->v3pay->setType($options['type'])->batches(
$orderId,
$amount,
$options['batch_name'],
@@ -164,8 +160,6 @@ class V3WechatPay extends BasePay implements PayInterface
]
]
);
-
- return $res;
}
/**
diff --git a/template/admin/src/api/order.js b/template/admin/src/api/order.js
index 0d817a3b7..6ba1e119c 100644
--- a/template/admin/src/api/order.js
+++ b/template/admin/src/api/order.js
@@ -26,10 +26,11 @@ export function orderList(data) {
* @description 发票头部统计
* @param {Object} param data {Object} 传值参数
*/
-export function orderInvoiceChart() {
+export function orderInvoiceChart(data) {
return request({
url: 'order/invoice/chart',
method: 'get',
+ params: data,
});
}
diff --git a/template/admin/src/components/from/from.vue b/template/admin/src/components/from/from.vue
index eb7e1a2e4..4886c8291 100644
--- a/template/admin/src/components/from/from.vue
+++ b/template/admin/src/components/from/from.vue
@@ -58,6 +58,7 @@ export default {
return {
modals: false,
type: 0,
+ loading: false,
config: {
global: {
upload: {
@@ -83,6 +84,8 @@ export default {
onSubmit(formData) {
let datas = {};
datas = formData;
+ if (this.loading) return;
+ this.loading = true;
request({
url: this.FromData.action,
method: this.FromData.method,
@@ -94,9 +97,11 @@ export default {
this.modals = false;
setTimeout(() => {
this.$emit('submitFail');
+ this.loading = false;
}, 1000);
})
.catch((res) => {
+ this.loading = false;
this.$Message.error(res.msg);
});
},
diff --git a/template/admin/src/components/goodsList/index.vue b/template/admin/src/components/goodsList/index.vue
index 400ba4e10..c3b8119ac 100644
--- a/template/admin/src/components/goodsList/index.vue
+++ b/template/admin/src/components/goodsList/index.vue
@@ -95,6 +95,12 @@ export default {
type: Boolean,
default: false,
},
+ selectIds: {
+ type: Array,
+ default: () => {
+ return [];
+ },
+ },
datas: {
type: Object,
default: function () {
@@ -259,6 +265,7 @@ export default {
} else {
this.getList();
}
+ console.log(this.diy);
},
methods: {
productList() {
@@ -324,7 +331,22 @@ export default {
}
changeListApi(this.formValidate)
.then(async (res) => {
+ console.log(this.selectIds);
+
let data = res.data;
+ if (this.selectIds.length) {
+ let arr = []
+ this.selectIds.map((item) => {
+ data.list.map((i) => {
+ if (i.id == item) {
+ console.log(i);
+ i._checked = true;
+ arr.push(i)
+ }
+ });
+ });
+ this.changeCheckbox(arr)
+ }
this.tableList = data.list;
this.total = res.data.count;
this.loading = false;
@@ -347,9 +369,23 @@ export default {
data.list.forEach((el) => {
el.image = el.cover_img;
});
- this.tableList = data.list;
- this.total = res.data.count;
- this.loading = false;
+
+ console.log(this.selectIds);
+ if (this.selectIds.length) {
+ this.selectIds.map((item) => {
+ data.list.map((i) => {
+ if (i.id == item) {
+ console.log(i);
+ i._checked = true;
+ }
+ });
+ });
+ }
+ this.$nextTick((e) => {
+ this.tableList = data.list;
+ this.total = res.data.count;
+ this.loading = false;
+ });
})
.catch((res) => {
this.loading = false;
diff --git a/template/admin/src/components/main/components/header-bar/sider-trigger/sider-trigger.less b/template/admin/src/components/main/components/header-bar/sider-trigger/sider-trigger.less
index 10163ded7..fcf681dc0 100644
--- a/template/admin/src/components/main/components/header-bar/sider-trigger/sider-trigger.less
+++ b/template/admin/src/components/main/components/header-bar/sider-trigger/sider-trigger.less
@@ -7,7 +7,7 @@
text-align: center;
// color: #fff;
cursor: pointer;
- z-index: 9999;
+ z-index: 99;
.iconcaidanshouqi {
.trans;
vertical-align: top;
diff --git a/template/admin/src/components/main/components/tags-nav/tags-nav.less b/template/admin/src/components/main/components/tags-nav/tags-nav.less
index 3ddb61f57..6cb1479d4 100644
--- a/template/admin/src/components/main/components/tags-nav/tags-nav.less
+++ b/template/admin/src/components/main/components/tags-nav/tags-nav.less
@@ -69,7 +69,7 @@
.scroll-body {
height: ~'calc(100% - 1px)';
display: inline-block;
- padding: 3px 20px 0 20px;
+ padding: 3px 40px 0 20px;
position: absolute;
overflow: visible;
white-space: nowrap;
diff --git a/template/admin/src/pages/app/wechat/reply/follow.vue b/template/admin/src/pages/app/wechat/reply/follow.vue
index 028cff914..5edb55924 100644
--- a/template/admin/src/pages/app/wechat/reply/follow.vue
+++ b/template/admin/src/pages/app/wechat/reply/follow.vue
@@ -133,7 +133,7 @@
文件最大2Mb,支持bmp/png/jpeg/jpg/gif格式
文件最大2Mb,支持mp3/wma/wav/amr格式,播放长度不超过60s文件最大2Mb,支持mp3格式,播放长度不超过60s
diff --git a/template/admin/src/pages/cms/addArticle/index.vue b/template/admin/src/pages/cms/addArticle/index.vue
index 60aff18cb..835c3ff51 100644
--- a/template/admin/src/pages/cms/addArticle/index.vue
+++ b/template/admin/src/pages/cms/addArticle/index.vue
@@ -37,7 +37,7 @@