__('The_way 2'), '1' => __('The_way 1'), '0' => __('The_way 0')]; } public function getStatusList() { return ['2' => __('Status 2'), '1' => __('Status 1'), '0' => __('Status 0'), '3' => __('Status 3')]; } public function getDeliveryTimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['delivery_time']) ? $data['delivery_time'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getTheWayTextAttr($value, $data) { $value = $value ? $value : (isset($data['the_way']) ? $data['the_way'] : ''); $list = $this->getTheWayList(); return isset($list[$value]) ? $list[$value] : ''; } public function getStatusTextAttr($value, $data) { $value = $value ? $value : (isset($data['status']) ? $data['status'] : ''); $list = $this->getStatusList(); return isset($list[$value]) ? $list[$value] : ''; } protected function setDeliveryTimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } public function supplier() { return $this->belongsTo('app\admin\model\ykjp\information\basisinfo\Supplier', 'supplier_id', 'id', [], 'LEFT')->setEagerlyType(0); } public function object_array($array) { if (is_object($array)) { $array = (array) $array; } if (is_array($array)) { foreach ($array as $key => $value) { $array[$key] = $this->object_array($value); } } return $array; } }