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/user/User.php b/crmeb/app/adminapi/controller/v1/user/User.php index 6f3795d0b..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) { 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/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/user/UserDao.php b/crmeb/app/dao/user/UserDao.php index c26240aa1..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 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/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/article/ArticleCategoryServices.php b/crmeb/app/services/article/ArticleCategoryServices.php index 4d8957ea3..141aae62c 100644 --- a/crmeb/app/services/article/ArticleCategoryServices.php +++ b/crmeb/app/services/article/ArticleCategoryServices.php @@ -154,7 +154,7 @@ class ArticleCategoryServices extends BaseServices */ public function getTreeList() { - $where['is_show'] = 1; + $where['status'] = 1; return sort_list_tier($this->dao->getMenus($where)); } } 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/StoreOrderRefundServices.php b/crmeb/app/services/order/StoreOrderRefundServices.php index 97dc9f9ed..481886199 100644 --- a/crmeb/app/services/order/StoreOrderRefundServices.php +++ b/crmeb/app/services/order/StoreOrderRefundServices.php @@ -433,18 +433,18 @@ class StoreOrderRefundServices extends BaseServices /** @var StoreOrderStatusServices $statusService */ $statusService = app()->make(StoreOrderStatusServices::class); $res = true; - //回退优惠卷 拆分子订单不退优惠券 - if (!$order['pid'] && $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', - 'change_message' => '商品退优惠券', - 'change_time' => time() - ]); - } +// //回退优惠卷 拆分子订单不退优惠券 +// if (!$order['pid'] && $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', +// 'change_message' => '商品退优惠券', +// 'change_time' => time() +// ]); +// } //回退积分 $order = $this->regressionIntegral($order); $statusService->save([ 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/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/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/UserServices.php b/crmeb/app/services/user/UserServices.php index 0afeae323..4720f16cd 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,16 @@ 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); + $userInfo['addres'] = $defaultAddressInfo['province'] . $defaultAddressInfo['city'] . $defaultAddressInfo['district'] . $defaultAddressInfo['detail']; + } + $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/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/marketing/channelCode/createCode.vue b/template/admin/src/pages/marketing/channelCode/createCode.vue index d77ccd61a..f3254659d 100644 --- a/template/admin/src/pages/marketing/channelCode/createCode.vue +++ b/template/admin/src/pages/marketing/channelCode/createCode.vue @@ -135,7 +135,7 @@ 文件最大2Mb,支持bmp/png/jpeg/jpg/gif格式 - 文件最大2Mb,支持mp3/wma/wav/amr格式,播放长度不超过60s + 文件最大2Mb,支持mp3格式,播放长度不超过60s diff --git a/template/admin/src/router/modules/setting.js b/template/admin/src/router/modules/setting.js index 5f846d037..7fbe0ed83 100644 --- a/template/admin/src/router/modules/setting.js +++ b/template/admin/src/router/modules/setting.js @@ -84,7 +84,7 @@ export default { name: `${pre}distributionSet`, meta: { ...meta, - title: '小程序配置', + title: '分销配置', }, component: () => import('@/pages/setting/setSystem/index'), }, diff --git a/template/uni-app/pages/points_mall/integral_order_details.vue b/template/uni-app/pages/points_mall/integral_order_details.vue index d444ad4d7..a91b7b9a7 100644 --- a/template/uni-app/pages/points_mall/integral_order_details.vue +++ b/template/uni-app/pages/points_mall/integral_order_details.vue @@ -55,8 +55,12 @@ {{$t(`支付积分`)}}: {{cartInfo.total_price}} + + {{$t(`订单备注`)}}: + {{cartInfo.mark}} + - {{$t(`备注`)}}: + {{$t(`商家备注`)}}: {{cartInfo.remark}}