getPk(); $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]); }); } public function getStatusList() { return ['normal' => __('Normal'), 'hidden' => __('Hidden')]; } public function getStatusTextAttr($value, $data) { $value = $value ? $value : (isset($data['status']) ? $data['status'] : ''); $list = $this->getStatusList(); return isset($list[$value]) ? $list[$value] : ''; } /** * 轮播位置 */ public function getPositionList(){ return [1 => __('Index'), 2 => __('Course'), 3 => __('Mine')]; } /** * 关联查询 * 品牌商 */ public function brand(){ return $this->belongsTo('\\app\\admin\\model\\xilufitness\\brand\\Index','brand_id','id',[],'LEFT')->setEagerlyType(0); } }