__('Status 0'), '2' => __('Status 2'), '20' => __('Status 20'), '22' => __('Status 22'), '30' => __('Status 30'), '40' => __('Status 40'), '50' => __('Status 50'), '60' => __('Status 60'), '70' => __('Status 70'), '80' => __('Status 80'), '90' => __('Status 90'), '92' => __('Status 92'), '100' => __('Status 100')]; } public function getStatusTextAttr($value, $data) { $value = $value ? $value : (isset($data['status']) ? $data['status'] : ''); $list = $this->getStatusList(); return isset($list[$value]) ? $list[$value] : ''; } public function getCanceltimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['canceltime']) ? $data['canceltime'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getFinishtimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['finishtime']) ? $data['finishtime'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getBaojiaConfirmtimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['baojia_confirmtime']) ? $data['baojia_confirmtime'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getCailiaoTimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['cailiao_time']) ? $data['cailiao_time'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getLingquTimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['lingqu_time']) ? $data['lingqu_time'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getShangmenTimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['shangmen_time']) ? $data['shangmen_time'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getWanchengTimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['wancheng_time']) ? $data['wancheng_time'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getEvaTimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['eva_time']) ? $data['eva_time'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } protected function setCanceltimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } protected function setFinishtimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } protected function setBaojiaConfirmtimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } protected function setCailiaoTimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } protected function setLingquTimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } protected function setShangmenTimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } protected function setWanchengTimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } protected function setEvaTimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } public function company() { return $this->belongsTo('Company', 'company_id', 'id', [], 'LEFT')->setEagerlyType(0); } public function user() { return $this->belongsTo('User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0); } public function usercompany() { return $this->belongsTo('Usercompany', 'uc_id', 'id', [], 'LEFT')->setEagerlyType(0); } public function worker() { return $this->belongsTo('Worker', 'worker_id', 'id', [], 'LEFT')->setEagerlyType(0); } }