feat: 优化消息互动中心与首页Banner呈现,同步全量业务数据与高清图标

这个提交包含在:
2026-10-24 11:39:44 +08:00
父节点 0f84426c33
当前提交 d18b597010
共有 109 个文件被更改,包括 3385 次插入 和 526 次删除

查看文件

@@ -27,9 +27,9 @@ class FcInstall extends Command
* image 留空时小程序用「亮绿底 + 墨绿字 + 白色插画」内置配图渲染。
*/
const BANNERS = [
['同城好物节 · 二手直降', '/pages/post/list?categoryId=3', 'linear-gradient(105deg, #00e070 0%, #00c860 42%, #046b3b 100%)'],
['招聘旺季 · 免费发布', '/pages/post/create', 'linear-gradient(105deg, #00d96c 0%, #00b85c 40%, #023a21 100%)'],
['本地服务 · 上门更省心', '/pages/post/list?categoryId=5', 'linear-gradient(105deg, #00e878 0%, #049e52 45%, #045c34 100%)'],
['同城好物节 · 二手直降', '/pages/post/list?categoryId=3', 'linear-gradient(120deg, #10b981 0%, #34d399 50%, #a7f3d0 100%)'],
['招聘旺季 · 免费发布', '/pages/post/create', 'linear-gradient(120deg, #059669 0%, #10b981 50%, #6ee7b7 100%)'],
['本地服务 · 上门更省心', '/pages/post/list?categoryId=5', 'linear-gradient(120deg, #00d26a 0%, #34d399 50%, #bbf7d0 100%)'],
];
/**

查看文件

@@ -24,14 +24,14 @@ class FcSeedPosts extends Command
const USERS = [
1001 => ['同城小助手', '13800001111'],
1002 => ['小王同学', '15033443344'],
1003 => ['洁净到家', '13156785678'],
2001 => ['顺捷物流', '13988888888'],
2002 => ['安家房产', '13566666666'],
2003 => ['骑行爱好者', '13712341234'],
2004 => ['车行天下', '13800000000'],
2005 => ['洁净到家', '13156785678'],
2006 => ['小王同学', '15033443344'],
2007 => ['优选二手车', '13700000000'],
1003 => ['洁净到家·陈姐', '13156785678'],
2001 => ['顺捷物流·杨经理', '13988888888'],
2002 => ['安家房产·周主管', '13566666666'],
2003 => ['骑行爱好者·小周', '13712341234'],
2004 => ['车行天下·张总', '13800000000'],
2005 => ['洁净到家·王师傅', '13156785678'],
2006 => ['数码达人·阿豪', '15033443344'],
2007 => ['优选二手车·赵经理', '13700000000'],
];
/** 区域中心坐标(gcj02 近似值,用于首页「附近」排序演示) */
@@ -82,6 +82,7 @@ class FcSeedPosts extends Command
'id' => $id,
'user_id' => $uid,
'category_id' => $categoryId,
'identity_type' => in_array($uid, [1003, 2001, 2002, 2004, 2005, 2007, 2011], true) ? 2 : 1,
'title' => $row[1],
'content' => $row[2],
'cover' => $media[0],
@@ -460,5 +461,17 @@ class FcSeedPosts extends Command
->count();
Db::name('fc_category')->where('id', $categoryId)->update(['post_count' => $count]);
}
// 同步商家有效发帖数
$merchants = Db::name('fc_merchant')->field('id,user_id')->select();
foreach ($merchants as $m) {
$mCount = Db::name('fc_post')
->where('user_id', $m['user_id'])
->where('audit_status', 1)
->where('status', 1)
->whereNull('deletetime')
->count();
Db::name('fc_merchant')->where('id', $m['id'])->update(['post_count' => $mCount]);
}
}
}

查看文件

@@ -3,44 +3,45 @@
namespace app\admin\model;
use think\Model;
use traits\model\SoftDelete;
use app\common\library\FcRelation;
/**
* 消息模型 · 同城分类信息
*/
class FcMessage extends Model
{
use SoftDelete;
// 表名
protected $name = 'fc_message';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'integer';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = false;
protected $deleteTime = false;
protected $updateTime = 'updatetime';
protected $deleteTime = 'deletetime';
// 追加属性
protected $append = [
'user_name',
];
/**
* 获取接收用户名属性
*
* @param mixed $value 原值
* @param array $data 当前行数据
* @return string 用户昵称或标识
*/
public function getUserNameAttr($value, $data)
{
return FcRelation::userName(isset($data['user_id']) ? $data['user_id'] : 0);
$uid = isset($data['user_id']) ? (int)$data['user_id'] : 0;
if ($uid === 0) {
return '全体用户(广播)';
}
return FcRelation::userName($uid);
}
}

查看文件

@@ -6,15 +6,11 @@
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<div id="toolbar" class="toolbar">
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" >刷新</a>
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('fc/message/add')?'':'hide'}" title="{:__('Add')}" >添加</a>
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('fc/message/edit')?'':'hide'}" title="{:__('Edit')}" >{:__('Edit')}</a>
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('fc/message/del')?'':'hide'}" title="{:__('Delete')}" >{:__('Delete')}</a>
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> 刷新</a>
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('fc/message/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> 添加</a>
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('fc/message/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('fc/message/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
<a class="btn btn-info btn-recyclebin btn-dialog {:$auth->check('fc/message/recyclebin')?'':'hide'}" href="fc/message/recyclebin" title="{:__('Recycle bin')}"><i class="fa fa-recycle"></i> 回收站</a>
</div>
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
data-operate-edit="{:$auth->check('fc/message/edit')}"