getPk(); $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]); }); } public function getIsPayList() { return ['0' => __('Is_pay 0'), '1' => __('Is_pay 1')]; } public function getStatusList() { return ['0' => __('Status 0'), '1' => __('Status 1')]; } public function getIsPayTextAttr($value, $data) { $value = $value ? $value : (isset($data['is_pay']) ? $data['is_pay'] : ''); $list = $this->getIsPayList(); 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 type() { return $this->belongsTo('Videotype', 'video_type_id', 'id', [], 'LEFT')->setEagerlyType(0); } public function cate() { return $this->belongsTo('Videocate', 'cate_id', 'id', [], 'LEFT')->setEagerlyType(0); } public function childcate() { return $this->belongsTo('Videochildcate', 'childcate_id', 'id', [], 'LEFT')->setEagerlyType(0); } }