TransferModel.php
1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
// +----------------------------------------------------------------------
// | bronet [ 以客户为中心 以奋斗者为本 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2017 http://www.bronet.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Powerless < wzxaini9@gmail.com>
// +----------------------------------------------------------------------
namespace app\user\model;
use app\portal\model\PortalPostModel;
use think\Db;
use think\Model;
class TransferModel extends Model
{
protected $type = [
'clinical' => 'array',
'inspected' => 'array',
'diagnose' => 'array',
'used_drugs' => 'array',
'problem' => 'array',
'reply' => 'array',
'problem_again' => 'array',
'reply_again' => 'array',
];
/**
* 后台管理添加
* @param array $data 数据
* @return $this
*/
public function adminAdd($data){
$this->allowField(true)->data($data, true)->isUpdate(false)->save();
return $this;
}
/**
* 后台管理编辑
* @param array $data 数据
* @return $this
*/
public function adminEdit($data){
$this->allowField(true)->isUpdate(true)->data($data, true)->save();
return $this;
}
public function getInfo($id){
$info=$this->alias('a')
->join('__USER__ b','a.user_id=b.id','LEFT')
->join('__HOSPITAL__ h','h.id=b.hospital',"LEFT")
->join('__OFFICE__ o','b.office=o.id',"LEFT")
->join('__JOB__ j','b.job=j.id',"LEFT")
->field('a.*,b.user_nickname,b.mobile,b.avatar,h.name as hospital,o.name as office,j.name as job')
->where(['a.id'=>$id])->find();
return $info;
}
}