作者 sgj

inquiry 添加内容

... ... @@ -65,7 +65,7 @@ class IndexController extends WeChatBaseController
$this->error('内部错误');
}else{
/*添加相应的信息到用户表*/
$insert['paltform']=$info['platform'];
$insert['platform']=$info['platform'];
$insert['hospital']=$info['hospital'];
$insert['office']=$info['office'];
$insert['job']=$info['job'];
... ...
... ... @@ -367,7 +367,21 @@ class IndexController extends HomeBaseController
$hospital=$Hospital->getHospital()->toArray();
$this->assign('hospital',$hospital);
$this->assign('platment',$platment);
dump($platment);
return $this->fetch();
}
/**
* 通过平台获取专家
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getExportByPlatment(){
$platment_id=input('platment_id');
$Hospital= new HospitalModel();
$User=new UserModel();
$export=$User->getExpertByPlatment($platment_id)->toArray();
$this->success('','',$export);
}
}
... ...
... ... @@ -421,5 +421,22 @@ class UserModel extends Model
return $userinfo;
}
/**
* 通过平台id获取到专家信息
* @param $id
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getExpertByPlatment($id){
$map['platform']=$id;
$map['is_expert']=1;
$user=$this
->where($map)
->field('user_login,avatar,job,hospital,id,office,platform')
->order('is_top Desc')
->select();
return $user;
}
}
... ...
... ... @@ -213,6 +213,7 @@
<!--<script src="__TMPL__/public/assets/js/referral.js"></script>-->
<script type="application/javascript">
//文本框显示字数
$(".area").on("input propertychange", function () {
var $this = $(this),
... ... @@ -233,32 +234,53 @@
</volist>
], {
onChange: function (res) {
console.log(res)
$('.expert_value').val('')
$('.expert_value').data('data-id','')
},
onConfirm: function (res) {
$('.inquiry_value').val(res[0].label)
$('.inquiry_value').data('data-id',res[0].value)
}
}
)
})
// 疾病分类下拉
$('.expert').click(function () {
var doctor = new Array()
var platment_id = $('.inquiry_value').data('data-id');
if (!platment_id) {
alert('请先选择疾病分类!');
return;
}
$.ajax({
url:'{:url()}',
url: '{:url('getExportByPlatment')}',
data: {
platment_id: platment_id
},
type: 'POST',
success: function (res) {
console.log(res);
})
weui.picker([
{label: '王医生', value: 0},
{label: '刘易斯', value: 1}
], {
onChange: function (res) {
console.log(res)
},
onConfirm: function (res) {
$('.expert_value').val(res[0].label)
for (key in res.data) {
var info = new Object();
info.label = res.data[key].user_login;
info.value = res.data[key].id;
doctor[key] = info
}
console.log(doctor);
var doctor1 = new Array();
weui.picker(doctor, {
onChange: function (res) {
console.log(res)
},
onConfirm: function (res) {
$('.expert_value').val(res[0].label)
$('.expert_value').data('data-id', res[0].value)
}
}
)
}
)
})
})
// 性别分类
$('.sex_type').click(function () {
... ...