__('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 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 serviceorder() { return $this->belongsTo(ServiceOrder::class, 'classes_service_order_id', 'id', [], 'LEFT')->setEagerlyType(0); } 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 admin() { return $this->belongsTo(Admin::class, 'oper_id', 'id', [], 'LEFT')->setEagerlyType(0); } }