__('Status 1'), '4' => __('Status 4'), '7' => __('Status 7'), '-3' => __('Status -3')]; } public function getServiceStautsList() { return ['1' => __('Service_stauts 1'), '4' => __('Service_stauts 4'), '7' => __('Service_stauts 7'), '-3' => __('Service_stauts -3')]; } public function getSalesTypeList() { return ['-3' => __('Sales_type -3'), '1' => __('Sales_type 1'), '4' => __('Sales_type 4'), '7' => __('Sales_type 7'), '10' => __('Sales_type 10')]; } public function getPlatformList() { return ['miniapp' => __('Platform miniapp')]; } public function getPayTypeList() { return ['yue' => __('Pay_type yue'), 'wechat' => __('Pay_type wechat')]; } public function getStatusTextAttr($value, $data) { $value = $value ? $value : (isset($data['status']) ? $data['status'] : ''); $list = $this->getStatusList(); return isset($list[$value]) ? $list[$value] : ''; } public function getServiceStautsTextAttr($value, $data) { $value = $value ? $value : (isset($data['service_stauts']) ? $data['service_stauts'] : ''); $list = $this->getServiceStautsList(); return isset($list[$value]) ? $list[$value] : ''; } public function getSalesTypeTextAttr($value, $data) { $value = $value ? $value : (isset($data['sales_type']) ? $data['sales_type'] : ''); $list = $this->getSalesTypeList(); return isset($list[$value]) ? $list[$value] : ''; } public function getPlatformTextAttr($value, $data) { $value = $value ? $value : (isset($data['platform']) ? $data['platform'] : ''); $list = $this->getPlatformList(); return isset($list[$value]) ? $list[$value] : ''; } public function getPayTypeTextAttr($value, $data) { $value = $value ? $value : (isset($data['pay_type']) ? $data['pay_type'] : ''); $list = $this->getPayTypeList(); return isset($list[$value]) ? $list[$value] : ''; } public function getRefundtimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['refundtime']) ? $data['refundtime'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getRejecttimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['rejecttime']) ? $data['rejecttime'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getHandletimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['handletime']) ? $data['handletime'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getConfirmtimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['confirmtime']) ? $data['confirmtime'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getCheckouttimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['checkouttime']) ? $data['checkouttime'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } protected function setRefundtimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } protected function setRejecttimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } protected function setHandletimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } protected function setConfirmtimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } protected function setCheckouttimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } public function classesorder() { return $this->belongsTo(Order::class, 'classes_order_id', 'id', [], 'LEFT')->setEagerlyType(0); } public function user() { return $this->belongsTo('app\common\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0); } public function detail() { return $this->belongsTo(OrderDetail::class, 'classes_order_detail_id', 'id', [], 'LEFT')->setEagerlyType(0); } public function lib() { return $this->belongsTo(ClassesLib::class, 'classes_lib_id', 'id', [], 'LEFT')->setEagerlyType(0); } public function manystore() { return $this->belongsTo(Manystore::class, 'manystore_id', 'id', [], 'LEFT')->setEagerlyType(0); } public function shop() { return $this->belongsTo(ManystoreShop::class, 'shop_id', 'id', [], 'LEFT')->setEagerlyType(0); } }