getPk(); $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]); }); } public function getTypeList() { return ['1' => __('Type 1'), '2' => __('Type 2')]; } public function getIsFreeList() { return ['0' => __('Is_free 0'), '1' => __('Is_free 1')]; } public function getIsOverlyingList() { return ['0' => __('Is_overlying 0'), '1' => __('Is_overlying 1')]; } public function getStatusList() { return ['0' => __('Status 0'), '1' => __('Status 1'), '2' => __('Status 2'), '3' => __('Status 3')]; } public function getShowstatusList() { return ['0' => __('Showstatus 0'), '1' => __('Showstatus 1')]; } public function getIsAutoshowList() { return ['0' => __('Is_autoshow 0'), '1' => __('Is_autoshow 1')]; } public function getIsBannerList() { return ['0' => __('Is_banner 0'), '1' => __('Is_banner 1')]; } public function getTypeTextAttr($value, $data) { $value = $value ? $value : (isset($data['type']) ? $data['type'] : ''); $list = $this->getTypeList(); return isset($list[$value]) ? $list[$value] : ''; } public function getStarttimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['starttime']) ? $data['starttime'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getEndtimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['endtime']) ? $data['endtime'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getCollectiontimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['collectiontime']) ? $data['collectiontime'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getSignupendtimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['signupendtime']) ? $data['signupendtime'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getRefundendtimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['refundendtime']) ? $data['refundendtime'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getIsFreeTextAttr($value, $data) { $value = $value ? $value : (isset($data['is_free']) ? $data['is_free'] : ''); $list = $this->getIsFreeList(); return isset($list[$value]) ? $list[$value] : ''; } public function getIsOverlyingTextAttr($value, $data) { $value = $value ? $value : (isset($data['is_overlying']) ? $data['is_overlying'] : ''); $list = $this->getIsOverlyingList(); 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] : ''; } public function getShowstatusTextAttr($value, $data) { $value = $value ? $value : (isset($data['showstatus']) ? $data['showstatus'] : ''); $list = $this->getShowstatuslist(); return isset($list[$value]) ? $list[$value] : ''; } public function getIsAutoshowTextAttr($value, $data) { $value = $value ? $value : (isset($data['is_autoshow']) ? $data['is_autoshow'] : ''); $list = $this->getIsAutoshowList(); return isset($list[$value]) ? $list[$value] : ''; } public function getShowtimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['showtime']) ? $data['showtime'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getIsBannerTextAttr($value, $data) { $value = $value ? $value : (isset($data['is_banner']) ? $data['is_banner'] : ''); $list = $this->getIsBannerList(); return isset($list[$value]) ? $list[$value] : ''; } protected function setStarttimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } protected function setEndtimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } protected function setCollectiontimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } protected function setSignupendtimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } protected function setRefundendtimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } protected function setShowtimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } }