|  | @@ -585,7 +585,12 @@ exit;
 | 
											
												
													
														|  |              case 'State.StateChange': // 用户在线状态变更
 |  |              case 'State.StateChange': // 用户在线状态变更
 | 
											
												
													
														|  |                  $info = $input["Info"];
 |  |                  $info = $input["Info"];
 | 
											
												
													
														|  |                  if($info["Action"] == "Login") { // 用户登录
 |  |                  if($info["Action"] == "Login") { // 用户登录
 | 
											
												
													
														|  | -                    \app\common\model\User::update(["is_online"=>1,"onlinetime"=>time()],["id"=>$info["To_Account"]]);
 |  | 
 | 
											
												
													
														|  | 
 |  | +                    $loginToday = Db::name('user')->where('id',$info["To_Account"])->whereTime('onlinetime', 'today')->find();
 | 
											
												
													
														|  | 
 |  | +                    if ($loginToday){
 | 
											
												
													
														|  | 
 |  | +                        \app\common\model\User::update(["is_online"=>1,"onlinetime"=>time()],["id"=>$info["To_Account"]]);
 | 
											
												
													
														|  | 
 |  | +                    }else{
 | 
											
												
													
														|  | 
 |  | +                        \app\common\model\User::update(["is_online"=>1,"onlinetime"=>time()],["id"=>$info["To_Account"]]);
 | 
											
												
													
														|  | 
 |  | +                    }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |                      $res = [];
 |  |                      $res = [];
 | 
											
												
													
														|  |                      $res["ActionStatus"] = "OK";
 |  |                      $res["ActionStatus"] = "OK";
 | 
											
										
											
												
													
														|  | @@ -749,7 +754,7 @@ exit;
 | 
											
												
													
														|  |  //                $res["ErrorInfo"] = "";
 |  |  //                $res["ErrorInfo"] = "";
 | 
											
												
													
														|  |  //                echo json_encode($res);
 |  |  //                echo json_encode($res);
 | 
											
												
													
														|  |  //                break;
 |  |  //                break;
 | 
											
												
													
														|  | -            case 'Group.CallbackBeforeSendMsg': // 群内发送消息之前
 |  | 
 | 
											
												
													
														|  | 
 |  | +           /* case 'Group.CallbackBeforeSendMsg': // 群内发送消息之前
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |                  $config = config("wxMiniProgram");
 |  |                  $config = config("wxMiniProgram");
 | 
											
												
													
														|  |                  $access_token_url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=".$config["appid"]."&secret=".$config["secret"];
 |  |                  $access_token_url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=".$config["appid"]."&secret=".$config["secret"];
 | 
											
										
											
												
													
														|  | @@ -801,7 +806,7 @@ exit;
 | 
											
												
													
														|  |                  }
 |  |                  }
 | 
											
												
													
														|  |  //                \app\common\model\Test::update(["content"=>json_encode($res)],["id"=>1]);
 |  |  //                \app\common\model\Test::update(["content"=>json_encode($res)],["id"=>1]);
 | 
											
												
													
														|  |                  echo json_encode($res);exit;
 |  |                  echo json_encode($res);exit;
 | 
											
												
													
														|  | -                break;
 |  | 
 | 
											
												
													
														|  | 
 |  | +                break;*/
 | 
											
												
													
														|  |              default:
 |  |              default:
 | 
											
												
													
														|  |                  break;
 |  |                  break;
 | 
											
												
													
														|  |          }
 |  |          }
 |