__('Status 0'), '1' => __('Status 1'), '2' => __('Status 2'), '10' => __('Status 10'), '21' => __('Status 21'), '22' => __('Status 22')]; } public function getRoadtypeList() { return ['1' => __('Roadtype 1'), '2' => __('Roadtype 2'), '3' => __('Roadtype 3')]; } public function getJxtypeList() { return ['0' => __('Jxtype 0'), '1' => __('Jxtype 1')]; } public function getStatusTextAttr($value, $data) { $value = $value ? $value : (isset($data['status']) ? $data['status'] : ''); $list = $this->getStatusList(); return isset($list[$value]) ? $list[$value] : ''; } public function getPaytimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['paytime']) ? $data['paytime'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getRoadtypeTextAttr($value, $data) { $value = $value ? $value : (isset($data['roadtype']) ? $data['roadtype'] : ''); $list = $this->getRoadtypeList(); return isset($list[$value]) ? $list[$value] : ''; } public function getCancleTimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['cancle_time']) ? $data['cancle_time'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getRefundTimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['refund_time']) ? $data['refund_time'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getJxtypeTextAttr($value, $data) { $value = $value ? $value : (isset($data['jxtype']) ? $data['jxtype'] : ''); $list = $this->getJxtypeList(); return isset($list[$value]) ? $list[$value] : ''; } public function getGoChufatimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['go_chufatime']) ? $data['go_chufatime'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getBackChufatimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['back_chufatime']) ? $data['back_chufatime'] : ''); 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; } protected function setPaytimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } protected function setCancleTimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } protected function setRefundTimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } protected function setGoChufatimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } protected function setBackChufatimeAttr($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); } public function product() { return $this->belongsTo('Product', 'product_id', 'id', [], 'LEFT')->setEagerlyType(0); } public function usera() { return $this->belongsTo('User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0); } public function userb() { return $this->belongsTo('User', 'share_uid', 'id', [], 'LEFT')->setEagerlyType(0); } }