1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <?php
- namespace app\admin\model;
- use think\Model;
- class Jiancejoblog extends Model
- {
-
-
- // 表名
- protected $table = 'jiance_joblog';
-
- // 自动写入时间戳字段
- protected $autoWriteTimestamp = 'integer';
- // 定义时间戳字段名
- protected $createTime = 'createtime';
- protected $updateTime = false;
- protected $deleteTime = false;
- // 追加属性
- protected $append = [
- 'hege_status_text'
- ];
-
-
- public function getHegeStatusList()
- {
- return ['1' => __('Hege_status 1'), '2' => __('Hege_status 2'), '3' => __('Hege_status 3')];
- }
- public function getHegeStatusTextAttr($value, $data)
- {
- $value = $value ? $value : (isset($data['hege_status']) ? $data['hege_status'] : '');
- $list = $this->getHegeStatusList();
- return isset($list[$value]) ? $list[$value] : '';
- }
- public function jiance()
- {
- return $this->belongsTo('Jiance', 'jiance_id', 'id', [], 'LEFT')->setEagerlyType(0);
- }
- public function project()
- {
- return $this->belongsTo('app\admin\model\jiance\Project', 'project_id', 'id', [], 'LEFT')->setEagerlyType(0);
- }
- public function worker()
- {
- return $this->belongsTo('Worker', 'worker_id', 'id', [], 'LEFT')->setEagerlyType(0);
- }
- }
|