kgdxpr 2 years ago
commit fa26bde421

@ -1,5 +1,7 @@
package com.dsideal.QingLong.Base.Model; package com.dsideal.QingLong.Base.Model;
import com.dsideal.QingLong.Collect.Model.CollectModel;
import com.dsideal.QingLong.LoginPerson.Model.LoginPersonModel;
import com.jfinal.kit.Kv; import com.jfinal.kit.Kv;
import com.jfinal.kit.StrKit; import com.jfinal.kit.StrKit;
import com.jfinal.plugin.activerecord.Db; import com.jfinal.plugin.activerecord.Db;
@ -332,18 +334,25 @@ public class BaseModel {
* *
* 2020-01-07 * 2020-01-07
* *
* @param teacher_id * @param person_id
* @return * @return
*/ */
public Record getPersonInfo(String teacher_id) { public Record getPersonInfo(String person_id) {
String sql = "select t1.*,t2.org_name as bureau_name from t_sys_loginperson as t1 left join t_base_organization as t2 on t1.bureau_id=t2.org_id where t1.person_id=?"; CollectModel cm = new CollectModel();
Record record = Db.findFirst(sql, teacher_id); if (cm.THIRD_PARTY_BASE_DATA == 0) {
if (record.getStr("telephone") == null) record.set("telephone", ""); String sql = "select t1.*,t2.org_name as bureau_name from t_sys_loginperson as t1 left join t_base_organization as t2 on t1.bureau_id=t2.org_id where t1.person_id=?";
else if (record.getStr("telephone").trim().equals("-1")) record.set("telephone", ""); Record record = Db.findFirst(sql, person_id);
if (record.getStr("telephone") == null) record.set("telephone", "");
if (record.getStr("email") == null) record.set("email", ""); else if (record.getStr("telephone").trim().equals("-1")) record.set("telephone", "");
else if (record.getStr("email").trim().equals("-1")) record.set("email", "");
return record; if (record.getStr("email") == null) record.set("email", "");
else if (record.getStr("email").trim().equals("-1")) record.set("email", "");
return record;
} else {
LoginPersonModel personModel = new LoginPersonModel();
Record record = personModel.getTyPersonInfo(person_id);
return record;
}
} }
/** /**

@ -297,9 +297,28 @@ public class LoginPersonModel {
sql = "select bureau_id from ds_base_student where user_id='722f6eac6c434735a2deb8b557ab2fe5' limit 1"; sql = "select bureau_id from ds_base_student where user_id='722f6eac6c434735a2deb8b557ab2fe5' limit 1";
record = Db.findFirst(sql, user_id); record = Db.findFirst(sql, user_id);
} }
sql = "select org_id,org_name from ds_base_bureau where org_id=?"; sql = "select org_id as bureau_id,org_name as bureau_name from ds_base_bureau where org_id=?";
String org_id = record.getStr("bureau_id"); String org_id = record.getStr("bureau_id");
Record res = Db.findFirst(sql, org_id); Record res = Db.findFirst(sql, org_id);
return res; return res;
} }
/**
*
*
* @param user_id
* @return
*/
public Record getTyPersonInfo(String user_id) {
//-- 老师
String sql = "select name as person_name from ds_base_teacher where user_id=? limit 1";
Record record = Db.findFirst(sql, user_id);
// -- 学生
if (record == null) {
sql = "select name as person_name from ds_base_student where user_id=? limit 1";
record = Db.findFirst(sql, user_id);
}
return record;
}
} }

Loading…
Cancel
Save