feat(fsgx): 完成全部24项开发任务 Phase1-7
Phase1 后端核心:
- 新增 fsgx_v1.sql 迁移脚本(is_queue_goods/frozen_points/available_points/no_assess)
- SystemConfigServices 返佣设置扩展(周期人数/分档比例/范围/时机)
- StoreOrderCreateServices 周期循环佣金计算
- StoreOrderTakeServices 佣金发放后同步冻结积分
- StoreProductServices/StoreProduct 保存 is_queue_goods
Phase2 后端接口:
- GET /api/hjf/brokerage/progress 佣金周期进度
- GET /api/hjf/assets/overview 资产总览
- HjfPointsServices 每日 frozen_points 0.4‰ 释放定时任务
- PUT /adminapi/hjf/member/{uid}/no_assess 不考核接口
- GET /adminapi/hjf/points/release_log 积分日志接口
Phase3 前端清理:
- hjfCustom.js 路由精简(仅保留 points/log)
- hjfQueue.js/hjfMember.js API 清理/重定向至 CRMEB 原生接口
- pages.json 公排→推荐佣金/佣金记录/佣金规则
Phase4-5 前端改造:
- queue/status.vue 推荐佣金进度页整体重写
- 商品详情/订单确认/支付结果页文案与逻辑改造
- 个人中心/资产页/引导页/规则页文案改造
- HjfQueueProgress/HjfRefundNotice/HjfAssetCard 组件改造
- 推广中心嵌入佣金进度摘要
- hjfMockData.js 全量更新(公排字段→佣金字段)
Phase6 Admin 增强:
- 用户列表新增 frozen_points/available_points 列及不考核操作按钮
- hjfPoints.js USE_MOCK=false 对接真实积分日志接口
Phase7 配置文档:
- docs/fsgx-phase7-config-checklist.md 后台配置与全链路验收清单
Made-with: Cursor
This commit is contained in:
160
pro_v3.5.1_副本/app/model/message/service/StoreService.php
Normal file
160
pro_v3.5.1_副本/app/model/message/service/StoreService.php
Normal file
@@ -0,0 +1,160 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\model\message\service;
|
||||
|
||||
|
||||
use app\model\user\User;
|
||||
use app\model\work\WorkMember;
|
||||
use crmeb\basic\BaseModel;
|
||||
use crmeb\traits\ModelTrait;
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* 客服
|
||||
* Class StoreService
|
||||
* @package app\model\message\service
|
||||
*/
|
||||
class StoreService extends BaseModel
|
||||
{
|
||||
use ModelTrait;
|
||||
|
||||
/**
|
||||
* 数据表主键
|
||||
* @var string
|
||||
*/
|
||||
protected $pk = 'id';
|
||||
|
||||
/**
|
||||
* 模型名称
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'store_service';
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $updateTime = false;
|
||||
|
||||
/**
|
||||
* @return \think\model\relation\HasOne
|
||||
*/
|
||||
public function workMember()
|
||||
{
|
||||
return $this->hasOne(WorkMember::class, 'uid', 'uid');
|
||||
}
|
||||
|
||||
protected function getAddTimeAttr($value)
|
||||
{
|
||||
if ($value) return date('Y-m-d H:i:s', $value);
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户名一对多关联
|
||||
* @return mixed
|
||||
*/
|
||||
public function user()
|
||||
{
|
||||
return $this->hasOne(User::class, 'uid', 'uid')->field(['uid', 'nickname'])->bind([
|
||||
'nickname' => 'nickname'
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* uid搜索器
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchUidAttr($query, $value)
|
||||
{
|
||||
$query->where('uid', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* status搜索器
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchStatusAttr($query, $value)
|
||||
{
|
||||
$query->where('status', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* status搜索器
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchAccountStatusAttr($query, $value)
|
||||
{
|
||||
$query->where('account_status', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* account搜索器
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchAccountAttr($query, $value)
|
||||
{
|
||||
$query->where('account', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* phone搜索器
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchPhoneAttr($query, $value)
|
||||
{
|
||||
$query->where('phone', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* customer
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchCustomerAttr($query, $value)
|
||||
{
|
||||
$query->where('customer', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户昵称搜索器
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchNicknameAttr($query, $value)
|
||||
{
|
||||
if ($value) $query->whereLike('nickname', '%' . $value . '%');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchOnlineAttr($query, $value)
|
||||
{
|
||||
$query->where('online', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户uid搜索器
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchNoUidAttr($query, $value)
|
||||
{
|
||||
if ($value) $query->whereNotIn('uid', $value);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\model\message\service;
|
||||
|
||||
|
||||
use crmeb\basic\BaseModel;
|
||||
use crmeb\traits\ModelTrait;
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* 客服留言反馈
|
||||
* Class StoreServiceFeedback
|
||||
* @package app\model\message\service
|
||||
*/
|
||||
class StoreServiceFeedback extends BaseModel
|
||||
{
|
||||
|
||||
use ModelTrait;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'store_service_feedback';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $pk = 'id';
|
||||
|
||||
/**
|
||||
* @param $value
|
||||
* @return false|string
|
||||
*/
|
||||
public function getAddTimeAttr($value)
|
||||
{
|
||||
return date('Y-m-d H:i:s', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 标题搜索
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchTitleAttr($query, $value)
|
||||
{
|
||||
$value && $query->whereLike('rela_name|phone|content|uid', "%" . $value . "%");
|
||||
}
|
||||
|
||||
}
|
||||
106
pro_v3.5.1_副本/app/model/message/service/StoreServiceLog.php
Normal file
106
pro_v3.5.1_副本/app/model/message/service/StoreServiceLog.php
Normal file
@@ -0,0 +1,106 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\model\message\service;
|
||||
|
||||
use app\model\user\User;
|
||||
use crmeb\basic\BaseModel;
|
||||
use crmeb\traits\ModelTrait;
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* 客服聊天记录
|
||||
* Class StoreServiceLog
|
||||
* @package app\model\message\service
|
||||
*/
|
||||
class StoreServiceLog extends BaseModel
|
||||
{
|
||||
use ModelTrait;
|
||||
|
||||
/**
|
||||
* 数据表主键
|
||||
* @var string
|
||||
*/
|
||||
protected $pk = 'id';
|
||||
|
||||
/**
|
||||
* 模型名称
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'store_service_log';
|
||||
|
||||
public function getAddTimeAttr($value)
|
||||
{
|
||||
return $value ? date('Y-m-d H:i:s', $value) : '';
|
||||
}
|
||||
|
||||
/**
|
||||
* 一对一关联
|
||||
* @return mixed
|
||||
*/
|
||||
public function service()
|
||||
{
|
||||
return $this->hasOne(StoreService::class, 'uid', 'uid')->field(['uid', 'nickname', 'avatar'])->bind([
|
||||
'nickname' => 'nickname',
|
||||
'avatar' => 'avatar'
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 一对一关联
|
||||
* @return mixed
|
||||
*/
|
||||
public function user()
|
||||
{
|
||||
return $this->hasOne(User::class, 'uid', 'uid')->field(['uid', 'nickname', 'avatar'])->bind([
|
||||
'nickname' => 'nickname',
|
||||
'avatar' => 'avatar'
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* uid搜索器
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchUidAttr($query, $value)
|
||||
{
|
||||
$query->where('uid|to_uid', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 聊天记录搜索器
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchChatAttr($query, $value)
|
||||
{
|
||||
$query->whereIn('uid', $value)->whereIn('to_uid', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchTypeAttr($query, $value)
|
||||
{
|
||||
$query->where('type', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchIsTouristAttr($query, $value)
|
||||
{
|
||||
$query->where('is_tourist', $value);
|
||||
}
|
||||
}
|
||||
106
pro_v3.5.1_副本/app/model/message/service/StoreServiceRecord.php
Normal file
106
pro_v3.5.1_副本/app/model/message/service/StoreServiceRecord.php
Normal file
@@ -0,0 +1,106 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\model\message\service;
|
||||
|
||||
|
||||
use app\model\user\User;
|
||||
use crmeb\basic\BaseModel;
|
||||
use crmeb\traits\ModelTrait;
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* 客服聊天用户记录
|
||||
* Class StoreServiceRecord
|
||||
* @package app\model\message\service
|
||||
*/
|
||||
class StoreServiceRecord extends BaseModel
|
||||
{
|
||||
use ModelTrait;
|
||||
|
||||
protected $name = 'store_service_record';
|
||||
|
||||
protected $pk = 'id';
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
* @var bool | string | int
|
||||
*/
|
||||
protected $updateTime = false;
|
||||
|
||||
/**
|
||||
* 用户关联
|
||||
* @return \think\model\relation\HasOne
|
||||
*/
|
||||
public function user()
|
||||
{
|
||||
return $this->hasOne(User::class, 'uid', 'to_uid')->field(['nickname', 'uid', 'avatar'])->bind([
|
||||
'wx_nickname' => 'nickname',
|
||||
'wx_avatar' => 'avatar',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 客服用户
|
||||
* @return \think\model\relation\HasOne
|
||||
*/
|
||||
public function service()
|
||||
{
|
||||
return $this->hasOne(StoreService::class, 'uid', 'to_uid')->field(['nickname', 'uid', 'avatar'])->bind([
|
||||
'kefu_nickname' => 'nickname',
|
||||
'kefu_avatar' => 'avatar',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送者id搜索器
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchUserIdAttr($query, $value)
|
||||
{
|
||||
$query->where('user_id', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 送达人uid搜索器
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchToUidAttr($query, $value)
|
||||
{
|
||||
$query->where('to_uid', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户昵称搜索器
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchTitleAttr($query, $value)
|
||||
{
|
||||
if ($value) {
|
||||
$query->whereIn('to_uid', function ($query) use ($value) {
|
||||
$query->name('user')->whereLike('nickname|uid', '%' . $value . '%')->field('uid');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否游客
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchIsTouristAttr($query, $value)
|
||||
{
|
||||
$query->where('is_tourist', $value);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
declare (strict_types=1);
|
||||
|
||||
namespace app\model\message\service;
|
||||
|
||||
use crmeb\basic\BaseModel;
|
||||
use crmeb\traits\ModelTrait;
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* 客服话术
|
||||
* Class StoreServiceSpeechcraft
|
||||
* @package app\model\message\service
|
||||
*/
|
||||
class StoreServiceSpeechcraft extends BaseModel
|
||||
{
|
||||
use ModelTrait;
|
||||
|
||||
/**
|
||||
* 表名
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'store_service_speechcraft';
|
||||
|
||||
/**
|
||||
* 主键
|
||||
* @var string
|
||||
*/
|
||||
protected $pk = 'id';
|
||||
|
||||
/**
|
||||
* 时间格式化
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @return false|string
|
||||
*/
|
||||
public function getAddTimeAttr($value, $data)
|
||||
{
|
||||
return date('Y-m-d H:i:s', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 话术搜索
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchTitleAttr($query, $value)
|
||||
{
|
||||
$query->whereLike('title', '%' . $value . '%');
|
||||
}
|
||||
|
||||
/**
|
||||
* 归属客服搜索
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchKefuIdAttr($query, $value)
|
||||
{
|
||||
if ($value !== '') {
|
||||
$query->where('kefu_id', $value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 分类搜索
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchCateIdAttr($query, $value)
|
||||
{
|
||||
if ($value !== '') {
|
||||
$query->where('cate_id', $value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchMessageAttr($query, $value)
|
||||
{
|
||||
if ($value) {
|
||||
$query->where('message', $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user