This commit is contained in:
Hankin 2026-03-10 16:08:28 +08:00
parent 72e58f13d5
commit 094fbaed78
3 changed files with 193 additions and 32 deletions

View File

@ -122,9 +122,13 @@ class DmaQuestionNotice extends Command
$start_time = date("Y-m-d H:i:s", strtotime("-3 month"));
$orders = Order::whereHas("group")->where("status", "FINISHED")->where("end_time", ">", $start_time)->get();
foreach ($orders as $order) {
$msg = "😊亲爱的【{$order->name}】,一份温馨小建议轻轻来送达!每周抽出 1 天做清洁保养巩固,有助于维持良好的身体状态,能让您的健康生活持续向好,更加精彩。";
$imMsg = new Msg(config('chat.im.app_id'), config('chat.im.app_secret'));
$imMsg->sendMsg(make_wangyiyun_accid($order->group->owner_id), 1, $order->group->im_chat_id, 0, json_encode(['msg' => $msg]));
// $msg = "😊亲爱的【{$order->name}】,一份温馨小建议轻轻来送达!每周抽出 1 天做清洁保养巩固,有助于维持良好的身体状态,能让您的健康生活持续向好,更加精彩。";
// $imMsg = new Msg(config('chat.im.app_id'), config('chat.im.app_secret'));
// $imMsg->sendMsg(make_wangyiyun_accid($order->group->owner_id), 1, $order->group->im_chat_id, 0, json_encode(['msg' => $msg]));
// 改为通知教练
$chatService = new ChatService();
$msg = "请提醒用户【{$order->name}】每周抽出1天做清洁保养巩固有助于维持良好的身体状态。";
$chatService->sendImMsgUserToUser($order->id, '系统通知', $msg, '', '', [ServiceRole::MAIN_COACH, ServiceRole::COACH, ServiceRole::CUSTOMER], [], []);
}
}

View File

@ -63,31 +63,188 @@ class Controller extends BaseController
public function test(Request $request)
{
// $host = "https://bizcard.market.alicloudapi.com";
// $path = "/rest/160601/ocr/ocr_business_card.json";
// $method = "POST";
// $appcode = "ad41385e76184cffab0a5dc7654f8db2";
// $headers = array();
// array_push($headers, "Authorization:APPCODE " . $appcode);
// //根据API的要求定义相对应的Content-Type
// array_push($headers, "Content-Type" . ":" . "application/json; charset=UTF-8");
// $querys = "";
// $bodys = "{\"image\":\"https://images.health.ufutx.com/202601/14/b71d821306083f5f5b1b0ee3bc8c5219.png\"}";
// $url = $host . $path;
// $curl = curl_init();
// curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
// curl_setopt($curl, CURLOPT_URL, $url);
// curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
// curl_setopt($curl, CURLOPT_FAILONERROR, false);
// curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
// curl_setopt($curl, CURLOPT_HEADER, true);
// if (1 == strpos("$" . $host, "https://")) {
// curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
// curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
// }
// curl_setopt($curl, CURLOPT_POSTFIELDS, $bodys);
// dd(curl_exec($curl));
$data = [
'stomach' => [
'title' => '肠胃不适反应有哪些(必选)',
'key1' => '没有不适',
'key2' => '恶心',
'key3' => '胃部反酸',
'key4' => '胃部疼痛',
'key5' => '便秘',
'key6' => '腹胀',
'key7' => '大便带血',
'key8' => '腹泻',
'key9' => '其它',
],
'heart' => [
'title' => '心脏不适有哪些(必选)',
'key1' => '没有不适',
'key2' => '心慌,心悸',
'key3' => '心率异常',
'key4' => '胸闷',
'key5' => '呼吸急促',
'key6' => '头晕',
'key7' => '打鼾',
'key8' => '其它',
],
'sleep' => [
'title' => '睡眠相关不适反应有哪些(必选)',
'key1' => '没有不适',
'key2' => '失眠',
'key3' => '入睡困难',
'key4' => '浅度睡眠',
'key5' => '视觉疲劳',
'key6' => '反应迟钝',
'key7' => '记忆力衰退',
'key8' => '焦虑',
'key9' => '困倦疲惫',
'key10' => '其它',
],
'man' => [
'title' => '目前男科问题有哪些(必选)',
'key1' => '没有不适',
'key2' => '不孕不育',
'key3' => '尿频尿急',
'key4' => '小腹胀痛',
'key5' => '其它',
],
'other' => [
'title' => '其它不适有哪些(必选)',
'key1' => '没有不适',
'key2' => '呼吸系统不好',
'key3' => '鼻炎',
'key4' => '腰酸背痛',
'key5' => '肌肉酸痛',
'key6' => '容易感冒',
'key7' => '虚弱无力',
'key8' => '无食欲',
'key9' => '容易感染',
'key10' => '皮肤问题',
'key11' => '哮踹',
'key12' => '耳鸣',
'key13' => '咳嗽',
'key14' => '水肿',
'key15' => '反应迟钝',
'key16' => '其它',
],
'dietary' => [
'title' => '您的饮食习惯(必选)',
'key1' => '一日三餐规律饮食',
'key2' => '饿了就吃',
'key3' => '偏好主食',
'key4' => '偏好蔬菜水果',
'key5' => '偏好肉类',
'key6' => '偏好甜食',
'key7' => '高盐高油',
'key8' => '其它',
'key9' => "一日一餐",
"key10" => "一日两餐",
"key11" => "一日四餐以上",
],
'living' => [
'title' => '您的生活习惯(必选)',
'key1' => '抽烟',
'key2' => '喝酒',
'key3' => '规律睡眠',
'key4' => '经常熬夜',
'key5' => '经常运动',
'key6' => '偶尔运动',
'key7' => '几乎不运动',
'key8' => '其它',
],
'mental' => [
'title' => '您目前精神心理状态有哪些(必选)',
'key1' => '经常感到职场压力',
'key2' => '经常感到夫妻关系压力',
'key3' => '经常感到父母关系压力',
'key4' => '经常感到亲子关系压力',
'key5' => '经常感到焦虑',
'key6' => '经常无故冲动',
'key7' => '经常处于心平气和的状态',
'key8' => '面对问题,能够快速的找到解决的办法',
'key9' => '开心愉悦',
'key10' => '其它',
],
'family' => [
'title' => '您目前家庭关系有哪些(必选)',
'key1' => '夫妻关系和睦',
'key2' => '亲子关系和睦',
'key3' => '我与父母关系和睦',
'key4' => '夫妻关系不和睦',
'key5' => '亲子关系不和睦',
'key6' => '我与父母关系不和睦',
'key7' => '其它',
],
'family_member' => [
'title' => '您家庭成员有哪些(必选)',
'key1' => '一个孩子',
'key2' => '两个孩子',
'key3' => '三个孩子及以上',
'key4' => '父亲',
'key5' => '母亲',
'key6' => '丈夫',
'key7' => '妻子',
'key8' => '其它',
],
'personal' => [
'title' => '个人情况(必选)',
'key1' => '已婚',
'key2' => '未婚',
'key3' => '离异',
'key4' => '丧偶',
'key5' => '财务方面压力较大',
'key6' => '财务方面压力较小',
'key7' => '财务方面毫无压力',
'key8' => '其它',
],
'woman' => [
'title' => '目前妇科问题有哪些(必选)',
'key1' => '没有不适',
'key2' => '月经不规律',
'key3' => '月经紊乱',
'key4' => '已绝经',
'key5' => '白带增多异常',
'key6' => '尿频尿急',
'key7' => '不孕不育',
'key8' => '小腹胀痛',
'key9' => '子宫肌瘤',
'key10' => '其它',
],
'know' => [
'title' => '您是否知悉、充分理解并自愿承担方案过程中因自身疾病问题而出现或可能出现的不可抗力或者并发症(如癫痫、抽搐、痉挛、病情加重等),除非经有权司法机关裁决事故系由本公司故意或重大过失引起的,否则本公司不承担任何法律责任(必选)',
'key1' => '完全知悉',
'key2' => '不知悉、不理解'
],
'understand' => [
'title' => '您是否充分理解本公司的健康学习方案原则,并同意严格按本公司的指导方法进行学习,并愿意承担方案过程中可能产生的任何不良反应(必选)',
'key1' => '充分理解',
'key2' => '不理解'
],
'really' => [
'title' => '您反映的身体症状,以及提供的医院的病例及检验数据(如有),是否真实、准确、完整?(必选)',
'key1' => '是',
'key2' => '否'
],
'duty' => [
'title' => '您是否自愿承担健康学习方案过程中突发性生命危险或病情加重的后果,并不以任何形式追究本公司的任何责任?(必选)',
'key1' => '是',
'key2' => '否'
],
'health_server' => [
'title' => '在未来的健康服务中,您更希望获得哪些类型的服务?(必选)',
'key1' => '服务人员具备专业的健康知识',
'key2' => '服务人员可以随时解答您的问题',
'key3' => '服务人员通过语音提供服务',
'key4' => '服务人员通过文字提供服务',
'key5' => '服务人员经常与您互动',
'key6' => '除非必要,请不要与我联系',
'key7' => '其它',
],
'desc' => [
'title' => "其它不适,请填写描述(必填)"
]
];
dd(json_encode($data, JSON_UNESCAPED_UNICODE));
}
public function test2()

View File

@ -20,7 +20,7 @@ use Illuminate\Support\Facades\Redis;
class ConfigService
{
public function stepConfig($user,$sex=1)
public function stepConfig($user, $sex = 1)
{
$step_two_info = [
[
@ -131,9 +131,9 @@ class ConfigService
['key' => 'key6', 'name' => trans('app.other.key6'), 'isDesc' => 0, 'warn' => false, 'isNot' => 0],
['key' => 'key7', 'name' => trans('app.other.key7'), 'isDesc' => 0, 'warn' => false, 'isNot' => 0],
['key' => 'key8', 'name' => trans('app.other.key8'), 'isDesc' => 0, 'warn' => false, 'isNot' => 0],
// ['key' => 'key9', 'name' => trans('app.other.key9'), 'isDesc' => 0,'warn'=>false,'isNot'=>0],
// ['key' => 'key9', 'name' => trans('app.other.key9'), 'isDesc' => 0,'warn'=>false,'isNot'=>0],
['key' => 'key10', 'name' => trans('app.other.key10'), 'isDesc' => 0, 'warn' => false, 'isNot' => 0],
// ['key' => 'key11', 'name' => trans('app.other.key11'), 'isDesc' => 0,'warn'=>false,'isNot'=>0],
// ['key' => 'key11', 'name' => trans('app.other.key11'), 'isDesc' => 0,'warn'=>false,'isNot'=>0],
['key' => 'key12', 'name' => trans('app.other.key12'), 'isDesc' => 0, 'warn' => false, 'isNot' => 0],
['key' => 'key13', 'name' => trans('app.other.key13'), 'isDesc' => 0, 'warn' => false, 'isNot' => 0],
['key' => 'key14', 'name' => trans('app.other.key14'), 'isDesc' => 0, 'warn' => false, 'isNot' => 0],
@ -289,7 +289,7 @@ class ConfigService
['key' => 'key8', 'name' => trans('app.personal.key8'), 'isDesc' => 1, 'warn' => false, 'isNot' => 0],
]
],
// [
// [
// 'index' => 'know',
// 'title' => trans('app.know.title'),
// 'isMultiple' => 0,