Commit 66844815 by biao

1

parent c6737c3e
......@@ -44,7 +44,7 @@ CREATE TABLE IF NOT EXISTS government_qr_dat(
qr_image text NOT NULL,
use_count int8 NOT NULL DEFAULT '0',
max_count int8 NOT NULL DEFAULT '0',
limit_date timestamp NOT NULL,
limit_date varchar(10) NOT NULL,
title text NOT NULL,
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
......@@ -198,8 +198,14 @@ CREATE TABLE IF NOT EXISTS user_mst(
account_id int8 NOT NULL DEFAULT '0',
child_age int8 NOT NULL DEFAULT '1',
role varchar(128) NOT NULL DEFAULT '0',
school_owner tinyint(1) NOT NULL DEFAULT '0',
class_owner tinyint(1) NOT NULL DEFAULT '0'
longitude text,
latitude text,
government_id int8 NOT NULL DEFAULT '0',
province varchar(64),
city varchar(64),
district varchar(64),
organization_submit_date timestamp,
organization_no varchar(255),
organization_title text,
......
1. 小程序开发者账号
1. 小程序开发者账号
1. 小程序开发者账号
2.小程序开发者后台开通地图插件
4.小程序后台需要加服务器ip白名单,生成二维码用
3.腾讯lbs账号
4.阿里云oss key
5.小程序绑定对应公众号
<?php
/**
* UserMst Entity
* $Id: UserMst.inc,v 1.1 2020/2/14 16:39:17 Exp $
* $Id: UserMst.inc,v 1.1 2020/2/18 20:07:42 Exp $
* @author zb
* @package jp.compass.entity
* @access public
......@@ -18,8 +18,14 @@ class UserMst extends CompassDynamicData
var $account_id;
var $child_age;
var $role;
var $school_owner;
var $class_owner;
var $longitude;
var $latitude;
var $government_id;
var $province;
var $city;
var $district;
var $organization_submit_date;
var $organization_no;
var $organization_title;
......@@ -54,8 +60,14 @@ class UserMst extends CompassDynamicData
$this->account_id = $record["account_id"];
$this->child_age = $record["child_age"];
$this->role = $record["role"];
$this->school_owner = $record["school_owner"];
$this->class_owner = $record["class_owner"];
$this->longitude = $record["longitude"];
$this->latitude = $record["latitude"];
$this->government_id = $record["government_id"];
$this->province = $record["province"];
$this->city = $record["city"];
$this->district = $record["district"];
$this->organization_submit_date = $record["organization_submit_date"];
$this->organization_no = $record["organization_no"];
$this->organization_title = $record["organization_title"];
......@@ -142,8 +154,14 @@ class UserMst extends CompassDynamicData
ParamUtil::copyObj2Array($v_param, $this, "account_id");
ParamUtil::copyObj2Array($v_param, $this, "child_age");
ParamUtil::copyObj2Array($v_param, $this, "role");
ParamUtil::copyObj2Array($v_param, $this, "school_owner");
ParamUtil::copyObj2Array($v_param, $this, "class_owner");
ParamUtil::copyObj2ArrayNullField($v_param, $this, "longitude");
ParamUtil::copyObj2ArrayNullField($v_param, $this, "latitude");
ParamUtil::copyObj2Array($v_param, $this, "government_id");
ParamUtil::copyObj2ArrayNullField($v_param, $this, "province");
ParamUtil::copyObj2ArrayNullField($v_param, $this, "city");
ParamUtil::copyObj2ArrayNullField($v_param, $this, "district");
ParamUtil::copyObj2ArrayNullField($v_param, $this, "organization_submit_date");
ParamUtil::copyObj2ArrayNullField($v_param, $this, "organization_no");
ParamUtil::copyObj2ArrayNullField($v_param, $this, "organization_title");
......
......@@ -26,15 +26,20 @@ class UserRole
$data = array();
$tmp = array("id"=>1, "title"=>"校长");
$tmp = array("id"=>1, "title"=>"家园用户");
array_push($data, $tmp);
$tmp = array("id"=>2, "title"=>"教师");
$tmp = array("id"=>2, "title"=>"家校用户");
array_push($data, $tmp);
$tmp = array("id"=>3, "title"=>"学生");
$tmp = array("id"=>3, "title"=>"高职用户");
array_push($data, $tmp);
$tmp = array("id"=>4, "title"=>"教育局领导");
array_push($data, $tmp);
$tmp = array("id"=>5, "title"=>"社会用户");
array_push($data, $tmp);
$result = array();
foreach ($data as $row) {
......
......@@ -8,13 +8,15 @@ ErrorLogger::doOutput("Compass...ajax_get_user_role.php....Start.", 0);
//获取参数
$unionId = ParamUtil::getRequestString("unionId");
$result = array();
//参数检查
if(empty($unionId)) {
$result["message"] = "参数错误!";
responseNG($result);
}
$result = array();
//判断用户是否存在
$param = array();
$param['unionid'] = $unionId;
......@@ -25,10 +27,12 @@ if(empty($userList)) {
responseNG($result);
}
$role = $userList[0]->id;
$userMst = $userList[0];
//接口返回数据
$result["role"] = $role;
$result["role"] = $userMst->role;
$result["schoolOwner"] = $userMst->school_owner;
$result["classOwner"] = $userMst->class_owner;
ErrorLogger::doOutput("Compass...ajax_get_user_role.php....End.", 0);
......
<?
// 共通类库
require_once ("../user_include.inc");
ErrorLogger::doOutput("Compass...ajax_leader_user_register.php....Start.", 0);
$openId = ParamUtil::getRequestString("openId");
$unionId = ParamUtil::getRequestString("unionId");
$qrId = ParamUtil::getRequestNumber("qrId", 0);
ErrorLogger::doOutput("Compass...ajax_leader_user_register.php....openId=" . $openId, 0);
ErrorLogger::doOutput("Compass...ajax_leader_user_register.php....unionId=" . $unionId, 0);
ErrorLogger::doOutput("Compass...ajax_leader_user_register.php....qrId=" . $qrId, 0);
$result = array();
//参数验证
if(empty($qrId)) {
$result["message"] = "参数错误!";
responseNG($result);
}
//判断用户是否已经存在
$param = array();
$param['openid'] = $openId;
$param['unionid'] = $unionId;
$param['delete_flg'] = false;
$userList = UserMst::getList($param,'id','desc', 0, 1);
if(!empty($userList)) {
$result["message"] = "用户已注册!";
responseOK($result);
}
//Qr数据
$governmentQrDat = GovernmentQrDat::getById($qrId);
if(empty($governmentQrDat)) {
$result["message"] = "参数错误!";
responseNG($result);
}
//检查使用次数
if($governmentQrDat->use_count >= $governmentQrDat->max_count) {
$result["message"] = "已超过注册次数!";
responseNG($result);
}
//检查日期限制
if(date("Y-m-d")> $governmentQrDat->limit_date) {
$result["message"] = "已超过可注册时间!";
responseNG($result);
}
//注册教育局领导账户
$userMst = new UserMst();
$userMst->openid = $openId;
$userMst->unionid = $unionId;
$userMst->government_id = $governmentQrDat->government_id;
$userMst->province = $governmentQrDat->province;
$userMst->city = $governmentQrDat->city;
$userMst->district = $governmentQrDat->district;
$userMst->save();
//设定到session中保持
$_SESSION['_user_'] = $user_mst;
ErrorLogger::doOutput("Compass...ajax_leader_user_register.php....End.", 0);
responseOK("注册成功!");
function responseNG($result) {
$result = array("status"=>"NG", "result"=>$result);
print json_encode($result);
exit;
}
function responseOK($result) {
$result = array("status"=>"OK", "result"=>$result);
print json_encode($result);
exit;
}
?>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment