diff --git a/crmeb/app/api/controller/v1/publics/ArticleController.php b/crmeb/app/api/controller/v1/publics/ArticleController.php index fd2c977a3..bf36294f8 100644 --- a/crmeb/app/api/controller/v1/publics/ArticleController.php +++ b/crmeb/app/api/controller/v1/publics/ArticleController.php @@ -34,8 +34,13 @@ class ArticleController */ public function lst($cid) { + if ($cid == 0) { + $where = ['is_hot' => 1]; + } else { + $where = ['cid' => $cid]; + } [$page, $limit] = $this->services->getPageValue(); - $list = $this->services->cidByArticleList(['cid' => $cid], $page, $limit, "id,title,image_input,visit,from_unixtime(add_time,'%Y-%m-%d %H:%i') as add_time,synopsis,url"); + $list = $this->services->cidByArticleList($where, $page, $limit, "id,title,image_input,visit,from_unixtime(add_time,'%Y-%m-%d %H:%i') as add_time,synopsis,url"); return app('json')->success($list); } diff --git a/crmeb/app/common.php b/crmeb/app/common.php index e329293df..3c3a4e6cb 100644 --- a/crmeb/app/common.php +++ b/crmeb/app/common.php @@ -24,6 +24,20 @@ use app\services\system\lang\LangCountryServices; use think\facade\Config; use think\facade\Log; +if (!function_exists('crmebLog')) { + /** + * CRMEB Log 日志 + * @param $msg + * @author 吴汐 + * @email 442384644@qq.com + * @date 2023/03/03 + */ + function crmebLog($msg) + { + Log::write($msg, 'crmeb'); + } +} + if (!function_exists('getWorkerManUrl')) { /** diff --git a/crmeb/app/dao/user/UserWechatUserDao.php b/crmeb/app/dao/user/UserWechatUserDao.php index 329371ca5..20cddac5b 100644 --- a/crmeb/app/dao/user/UserWechatUserDao.php +++ b/crmeb/app/dao/user/UserWechatUserDao.php @@ -240,6 +240,10 @@ class UserWechatUserDao extends BaseDao if (isset($where['time'])) { $model->withSearch(['time'], ['time' => $where['time'], 'timeKey' => 'u.add_time']); } + + if (isset($where['is_del'])) { + $model->where($userAlias . 'is_del', $where['is_del']); + } return $field ? $model->field($field) : $model; } diff --git a/crmeb/app/model/wechat/WechatUser.php b/crmeb/app/model/wechat/WechatUser.php index 0735ff4e2..e1fe41906 100644 --- a/crmeb/app/model/wechat/WechatUser.php +++ b/crmeb/app/model/wechat/WechatUser.php @@ -127,4 +127,18 @@ class WechatUser extends BaseModel return $query->where('user_type', $value); } + /** + * is_del 搜索器 + * @param $query + * @param $value + * @return void + * @author 吴汐 + * @email 442384644@qq.com + * @date 2023/03/03 + */ + public function searchIsDelAttr($query, $value) + { + if($value !== '') return $query->where('is_del', $value); + } + } diff --git a/crmeb/app/services/other/export/ExportServices.php b/crmeb/app/services/other/export/ExportServices.php index 1f78f9025..4edd3fdc9 100644 --- a/crmeb/app/services/other/export/ExportServices.php +++ b/crmeb/app/services/other/export/ExportServices.php @@ -33,7 +33,7 @@ class ExportServices extends BaseServices /** @var UserServices $userServices */ $userServices = app()->make(UserServices::class); $data = $userServices->index($where)['list']; - $header = ['用户ID', '昵称', '真实姓名', '性别', '电话', '用户等级', '用户分组', '用户标签', '用户类型', '用户余额', '最后登录时间', '注册时间']; + $header = ['用户ID', '昵称', '真实姓名', '性别', '电话', '用户等级', '用户分组', '用户标签', '用户类型', '用户余额', '最后登录时间', '注册时间', '是否注销']; $filename = '用户列表_' . date('YmdHis', time()); $export = $fileKey = []; if (!empty($data)) { @@ -51,7 +51,8 @@ class ExportServices extends BaseServices 'user_type' => $item['user_type'], 'now_money' => $item['now_money'], 'last_time' => date('Y-m-d H:i:s', $item['last_time']), - 'add_time' => date('Y-m-d H:i:s', $item['add_time']) + 'add_time' => date('Y-m-d H:i:s', $item['add_time']), + 'is_del' => $item['is_del'] ? '已注销' : '正常' ]; $export[] = $one_data; if ($i == 0) { diff --git a/crmeb/app/services/product/product/StoreCategoryServices.php b/crmeb/app/services/product/product/StoreCategoryServices.php index 82c3d88a2..a63a57e77 100644 --- a/crmeb/app/services/product/product/StoreCategoryServices.php +++ b/crmeb/app/services/product/product/StoreCategoryServices.php @@ -96,7 +96,7 @@ class StoreCategoryServices extends BaseServices $where = []; if ($show !== '') $where['is_show'] = $show; if (!$type) $where['pid'] = 0; - $data = get_tree_children($this->dao->getTierList($where, ['id', 'cate_name as title', 'pid']), 'children', 'id'); + $data = get_tree_children($this->dao->getTierList($where, ['id', 'id as value', 'cate_name as label', 'cate_name as title', 'pid']), 'children', 'id'); foreach ($data as &$item) { if (!isset($item['children'])) { $item['disabled'] = true; diff --git a/crmeb/app/services/system/log/SystemFileServices.php b/crmeb/app/services/system/log/SystemFileServices.php index 9893dfa91..2a8600cbd 100644 --- a/crmeb/app/services/system/log/SystemFileServices.php +++ b/crmeb/app/services/system/log/SystemFileServices.php @@ -167,7 +167,7 @@ class SystemFileServices extends BaseServices $update_time = stat($vo); $cthash = md5_file($vo); $cha[] = [ - 'filename' => $vo, + 'filename' => str_replace($rootPath, '', $vo), 'cthash' => $cthash, 'atime' => date('Y-m-d H:i:s', $update_time['atime']), 'mtime' => date('Y-m-d H:i:s', $update_time['mtime']), diff --git a/crmeb/app/services/user/UserLevelServices.php b/crmeb/app/services/user/UserLevelServices.php index 73e98da19..b022eed59 100644 --- a/crmeb/app/services/user/UserLevelServices.php +++ b/crmeb/app/services/user/UserLevelServices.php @@ -217,7 +217,7 @@ class UserLevelServices extends BaseServices } else { $msg = '添加用户等级'; } - $field[] = Form::input('name', '等级名称', isset($vipInfo) ? $vipInfo->name : '')->col(24)->required(); + $field[] = Form::input('name', '等级名称', isset($vipInfo) ? $vipInfo->name : '')->maxlength(10)->col(24)->required(); $field[] = Form::number('grade', '等级', isset($vipInfo) ? $vipInfo->grade : 0)->min(0)->precision(0)->col(8)->required(); $field[] = Form::number('discount', '享受折扣', isset($vipInfo) ? $vipInfo->discount : 100)->min(0)->max(100)->col(8)->placeholder('输入折扣数100,代表原价,90代表9折')->required(); $field[] = Form::number('exp_num', '解锁需经验值达到', isset($vipInfo) ? $vipInfo->exp_num : 0)->min(0)->precision(0)->col(8)->required(); diff --git a/crmeb/app/services/wechat/WechatServices.php b/crmeb/app/services/wechat/WechatServices.php index 439417874..f5d1d998b 100644 --- a/crmeb/app/services/wechat/WechatServices.php +++ b/crmeb/app/services/wechat/WechatServices.php @@ -378,8 +378,8 @@ class WechatServices extends BaseServices if ($userInfo['unionid'] && $storeUserMobile) { /** @var UserServices $userServices */ $userServices = app()->make(UserServices::class); - $uid = $this->dao->value(['unionid' => $userInfo['unionid']], 'uid'); - $res = $userServices->value(['uid' => $uid], 'phone'); + $uid = $this->dao->value(['unionid' => $userInfo['unionid'], 'is_del' => 0], 'uid'); + $res = $userServices->value(['uid' => $uid, 'is_del' => 0], 'phone'); if (!$uid && !$res) { return false; } diff --git a/crmeb/config/log.php b/crmeb/config/log.php index 63a077b99..b4f43101e 100644 --- a/crmeb/config/log.php +++ b/crmeb/config/log.php @@ -17,7 +17,7 @@ return [ // 默认日志记录通道 'default' => Env::get('log.channel', 'file'), // 日志记录级别 - 'level' => ['error', 'warning', 'fail', 'success', 'info', 'notice', 'crontab'], + 'level' => ['error', 'warning', 'fail', 'success', 'info', 'notice', 'crontab', 'crmeb'], // 日志类型记录的通道 ['error'=>'email',...] 'type_channel' => [], //是否开启业务成功日志 @@ -36,7 +36,7 @@ return [ // 单文件日志写入 'single' => false, // 独立日志级别 - 'apart_level' => ['error', 'fail', 'success', 'crontab'], + 'apart_level' => ['error', 'fail', 'success', 'crontab', 'crmeb'], // 最大日志文件数量 'max_files' => 60, 'time_format' => 'Y-m-d H:i:s', diff --git a/template/uni-app/pages/extension/news_list/index.vue b/template/uni-app/pages/extension/news_list/index.vue index b3f527fd9..2c0c82da8 100644 --- a/template/uni-app/pages/extension/news_list/index.vue +++ b/template/uni-app/pages/extension/news_list/index.vue @@ -124,7 +124,8 @@ * 生命周期函数--监听页面显示 */ onShow: function() { - this.getArticleHot(); + // this.getArticleHot(); + this.getCidArticle(0); this.getArticleBanner(); this.getArticleCate(); this.status = false;