diff --git a/crmeb/app/adminapi/controller/v1/order/RefundOrder.php b/crmeb/app/adminapi/controller/v1/order/RefundOrder.php index 0c4cd2936..dd2c64fe6 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; diff --git a/crmeb/app/adminapi/controller/v1/user/User.php b/crmeb/app/adminapi/controller/v1/user/User.php index 3767ce9d1..6f3795d0b 100644 --- a/crmeb/app/adminapi/controller/v1/user/User.php +++ b/crmeb/app/adminapi/controller/v1/user/User.php @@ -387,7 +387,7 @@ 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])) { + if ($this->services->count(['phone' => $data['phone'], 'is_del' => 0, 'not_uid' => $id])) { return app('json')->fail(400314); } if ($data['card_id']) { 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/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/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/StoreOrderRefundServices.php b/crmeb/app/services/order/StoreOrderRefundServices.php index d850b6cb8..3fd06be86 100644 --- a/crmeb/app/services/order/StoreOrderRefundServices.php +++ b/crmeb/app/services/order/StoreOrderRefundServices.php @@ -1064,7 +1064,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..0933c9aa6 100644 --- a/crmeb/app/services/order/StoreOrderServices.php +++ b/crmeb/app/services/order/StoreOrderServices.php @@ -2351,6 +2351,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; } 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/template/admin/src/pages/marketing/live/anchor.vue b/template/admin/src/pages/marketing/live/anchor.vue index bf4f63891..61e164a3c 100644 --- a/template/admin/src/pages/marketing/live/anchor.vue +++ b/template/admin/src/pages/marketing/live/anchor.vue @@ -26,7 +26,7 @@
diff --git a/template/admin/src/pages/marketing/live/components/live_detail.vue b/template/admin/src/pages/marketing/live/components/live_detail.vue index 267362404..8c44c64ec 100644 --- a/template/admin/src/pages/marketing/live/components/live_detail.vue +++ b/template/admin/src/pages/marketing/live/components/live_detail.vue @@ -12,7 +12,8 @@
- {{ FormData.room_id }} + {{ FormData.id }} + (微信直播间ID:{{ FormData.room_id }})
@@ -51,15 +52,15 @@
- + {{ FormData.close_like | filterClose }}
- + {{ FormData.close_goods | filterClose }}
- + {{ FormData.close_comment | filterClose }}
diff --git a/template/admin/src/pages/marketing/live/index.vue b/template/admin/src/pages/marketing/live/index.vue index 97cb694f7..322a78f4b 100644 --- a/template/admin/src/pages/marketing/live/index.vue +++ b/template/admin/src/pages/marketing/live/index.vue @@ -79,8 +79,8 @@ 详情 删除 - - 添加商品 + + 添加商品