Merge branch 'yongpxu-dev' into yongpxu-dev2

# Conflicts:
#	Cunkebao/dist/.vite/manifest.json
#	Cunkebao/dist/index.html
This commit is contained in:
超级老白兔
2025-09-22 14:17:17 +08:00
4 changed files with 27 additions and 35 deletions

1
Cunkebao/.env.local Normal file
View File

@@ -0,0 +1 @@
NEXT_PUBLIC_API_BASE_URL= http://yishi.com

View File

@@ -120,7 +120,7 @@ class GetAddFriendPlanDetailV1Controller extends Controller
// 解析JSON字段 // 解析JSON字段
$sceneConf = json_decode($plan['sceneConf'], true) ?: []; $sceneConf = json_decode($plan['sceneConf'], true) ?: [];
$reqConf = json_decode($plan['reqConf'], true) ?: []; $reqConf = json_decode($plan['reqConf'], true) ?: [];
$reqConf['deveiceGroups'] = $reqConf['device']; $reqConf['deviceGroups'] = $reqConf['device'];
$msgConf = json_decode($plan['msgConf'], true) ?: []; $msgConf = json_decode($plan['msgConf'], true) ?: [];
$tagConf = json_decode($plan['tagConf'], true) ?: []; $tagConf = json_decode($plan['tagConf'], true) ?: [];
@@ -139,8 +139,8 @@ class GetAddFriendPlanDetailV1Controller extends Controller
} }
if (!empty($reqConf['deveiceGroups'])){ if (!empty($reqConf['deviceGroups'])){
$deveiceGroupsOptions = DeviceModel::alias('d') $deviceGroupsOptions = DeviceModel::alias('d')
->field([ ->field([
'd.id', 'd.imei', 'd.memo', 'd.alive', 'd.id', 'd.imei', 'd.memo', 'd.alive',
'l.wechatId', 'l.wechatId',
@@ -149,16 +149,16 @@ class GetAddFriendPlanDetailV1Controller extends Controller
->leftJoin('device_wechat_login l', 'd.id = l.deviceId and l.alive =' . DeviceWechatLoginModel::ALIVE_WECHAT_ACTIVE . ' and l.companyId = d.companyId') ->leftJoin('device_wechat_login l', 'd.id = l.deviceId and l.alive =' . DeviceWechatLoginModel::ALIVE_WECHAT_ACTIVE . ' and l.companyId = d.companyId')
->leftJoin('wechat_account a', 'l.wechatId = a.wechatId') ->leftJoin('wechat_account a', 'l.wechatId = a.wechatId')
->order('d.id desc') ->order('d.id desc')
->whereIn('d.id',$reqConf['deveiceGroups']) ->whereIn('d.id',$reqConf['deviceGroups'])
->select(); ->select();
foreach ($deveiceGroupsOptions as &$device) { foreach ($deviceGroupsOptions as &$device) {
$curstomer = WechatCustomerModel::field('friendShip')->where(['wechatId' => $device['wechatId']])->find(); $curstomer = WechatCustomerModel::field('friendShip')->where(['wechatId' => $device['wechatId']])->find();
$device['totalFriend'] = $curstomer->friendShip->totalFriend ?? 0; $device['totalFriend'] = $curstomer->friendShip->totalFriend ?? 0;
} }
unset($device); unset($device);
$reqConf['deveiceGroupsOptions'] = $deveiceGroupsOptions; $reqConf['deviceGroupsOptions'] = $deviceGroupsOptions;
}else{ }else{
$reqConf['deveiceGroupsOptions'] = []; $reqConf['deviceGroupsOptions'] = [];
} }

View File

@@ -55,11 +55,9 @@ class Workbench extends Validate
'distributeType' => 'requireIf:type,5|in:1,2', 'distributeType' => 'requireIf:type,5|in:1,2',
'maxPerDay' => 'requireIf:type,5|number|min:1', 'maxPerDay' => 'requireIf:type,5|number|min:1',
'timeType' => 'requireIf:type,5|in:1,2', 'timeType' => 'requireIf:type,5|in:1,2',
'startTime' => 'requireIf:type,5|dateFormat:H:i',
'endTime' => 'requireIf:type,5|dateFormat:H:i',
'accountGroups' => 'requireIf:type,5|array|min:1', 'accountGroups' => 'requireIf:type,5|array|min:1',
// 通用参数 // 通用参数
'deveiceGroups' => 'requireIf:type,1,2,5|array', 'deviceGroups' => 'requireIf:type,1,2,5|array',
]; ];
/** /**
@@ -142,8 +140,8 @@ class Workbench extends Validate
'timeType.requireIf' => '请选择时间类型', 'timeType.requireIf' => '请选择时间类型',
// 通用提示 // 通用提示
'deveiceGroups.require' => '请选择设备', 'deviceGroups.require' => '请选择设备',
'deveiceGroups.array' => '设备格式错误', 'deviceGroups.array' => '设备格式错误',
'targetGroups.require' => '请选择目标用户组', 'targetGroups.require' => '请选择目标用户组',
'targetGroups.array' => '目标用户组格式错误', 'targetGroups.array' => '目标用户组格式错误',
'accountGroups.requireIf' => '流量分发时必须选择分发账号', 'accountGroups.requireIf' => '流量分发时必须选择分发账号',
@@ -155,7 +153,7 @@ class Workbench extends Validate
* 验证场景 * 验证场景
*/ */
protected $scene = [ protected $scene = [
'create' => ['name', 'type', 'autoStart', 'deveiceGroups', 'targetGroups', 'create' => ['name', 'type', 'autoStart', 'deviceGroups', 'targetGroups',
'interval', 'maxLikes', 'startTime', 'endTime', 'contentTypes', 'interval', 'maxLikes', 'startTime', 'endTime', 'contentTypes',
'syncInterval', 'syncCount', 'syncType', 'syncInterval', 'syncCount', 'syncType',
'pushType', 'startTime', 'endTime', 'maxPerDay', 'pushOrder', 'isLoop', 'status', 'wechatGroups', 'contentGroups', 'pushType', 'startTime', 'endTime', 'maxPerDay', 'pushOrder', 'isLoop', 'status', 'wechatGroups', 'contentGroups',
@@ -163,7 +161,7 @@ class Workbench extends Validate
'groupNameTemplate', 'maxGroupsPerDay', 'groupSizeMin', 'groupSizeMax', 'groupNameTemplate', 'maxGroupsPerDay', 'groupSizeMin', 'groupSizeMax',
], ],
'update_status' => ['id', 'status'], 'update_status' => ['id', 'status'],
'edit' => ['name', 'type', 'autoStart', 'deveiceGroups', 'targetGroups', 'edit' => ['name', 'type', 'autoStart', 'deviceGroups', 'targetGroups',
'interval', 'maxLikes', 'startTime', 'endTime', 'contentTypes', 'interval', 'maxLikes', 'startTime', 'endTime', 'contentTypes',
'syncInterval', 'syncCount', 'syncType', 'syncInterval', 'syncCount', 'syncType',
'pushType', 'startTime', 'endTime', 'maxPerDay', 'pushOrder', 'isLoop', 'status', 'wechatGroups', 'contentGroups', 'pushType', 'startTime', 'endTime', 'maxPerDay', 'pushOrder', 'isLoop', 'status', 'wechatGroups', 'contentGroups',

View File

@@ -687,34 +687,27 @@ const MessageRecord: React.FC<MessageRecordProps> = ({ contract }) => {
}; };
const handQuote = (messageData: ChatRecord) => { const handQuote = (messageData: ChatRecord) => {
//判断如果是用户
const isGroupUser = !!currentContract?.chatroomId; const isGroupUser = !!currentContract?.chatroomId;
const isSend = !!messageData.isSend;
const nickname = currentContract?.nickname || "";
const SEPARATOR = "\n----------------------------------\n";
const rawContent = messageData.content || "";
const isSend = messageData.isSend; //是否为我方发送
const nickname = currentContract.nickname;
let sendMessageText = "";
if (isGroupUser) { if (isGroupUser) {
const GroupNickname = messageData.sender.nickname; const groupNickname = messageData?.sender?.nickname || "";
const content = messageData.content.replace( // 群消息里,非本人消息通常以 "wechatId:\n" 开头,清理前缀
`${messageData.sender.wechatId}:\n`, const content = rawContent.replace(
`${messageData?.sender?.wechatId}:\n`,
"", "",
); );
if (isSend) { const text = isSend ? rawContent : `@${groupNickname}${content}`;
sendMessageText = `${messageData.content}\n----------------------------------\n`; updateQuoteMessageContent(`${text}${SEPARATOR}`);
} else { return;
console.log(messageData);
sendMessageText = `@${GroupNickname}${content}\n----------------------------------\n`;
}
} else {
if (isSend) {
sendMessageText = `${messageData.content}\n----------------------------------\n`;
} else {
sendMessageText = `@${nickname}${messageData.content}\n----------------------------------\n`;
}
//当前用户的昵称
} }
updateQuoteMessageContent(sendMessageText); const text = isSend ? rawContent : `@${nickname}${rawContent}`;
updateQuoteMessageContent(`${text}${SEPARATOR}`);
}; };
const handCommad = (action: string) => { const handCommad = (action: string) => {