__('Status 1'), '2' => __('Status 2'), //'3' => __('Status 3'), '-1' => __('Status -1')]; } public function getHandleTypeList() { return ['1' => __('Handle_type 1'), '2' => __('Handle_type 2'), '3' => __('Handle_type 3'), '4' => __('Handle_type 4')]; } public function getFromList() { return ['1' => __('From 1'), '2' => __('From 2'), '3' => __('From 3')]; } public function getRefundTypeList() { return ['0' => __('Refund_type 0'),'1' => __('Refund_type 1'), '2' => __('Refund_type 2')]; } public function getWorkerRefundEntryList() { return ['0' => __('Worker_refund_entry 0'), '1' => __('Worker_refund_entry 1')]; } public function getStatusTextAttr($value, $data) { $value = $value ?: ($data['status'] ?? ''); $list = $this->getStatusList(); return $list[$value] ?? ''; } public function getHandleTypeTextAttr($value, $data) { $value = $value ?: ($data['handle_type'] ?? ''); $list = $this->getHandleTypeList(); return $list[$value] ?? ''; } public function getFromTextAttr($value, $data) { $value = $value ?: ($data['from'] ?? ''); $list = $this->getFromList(); return $list[$value] ?? ''; } public function getRefundTypeTextAttr($value, $data) { $value = $value ?: ($data['refund_type'] ?? ''); $list = $this->getRefundTypeList(); return $list[$value] ?? ''; } public function getWorkerRefundEntryTextAttr($value, $data) { $value = $value ?: ($data['worker_refund_entry'] ?? ''); $list = $this->getWorkerRefundEntryList(); return $list[$value] ?? ''; } public function order() { return $this->belongsTo('Order', 'order_id', 'id', [], 'LEFT')->setEagerlyType(0); } }