JobModel.php
646 字节
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
<?php
/**
* Created by PhpStorm.
* auther: sgj
* Date: 2018/12/4
* Time: 14:49
*/
namespace app\admin\model;
use think\Model;
use traits\model\SoftDelete;
class JobModel extends Model
{
use SoftDelete;
protected $deleteTime = 'delete_time';
protected $insert =['addtime'];
public function getJob($jobId=''){
if (!empty($jobId)){
$map['id']=$jobId;
}else{
$map='';
}
$job=$this->where($map)->select();
return $job;
}
public function addJob($name){
$data['name']=$name;
$return=$this->insert($data);
return $return;
}
}