getPk(); $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]); }); } public function getToshopList() { return ['door' => __('To_shop door'), 'shop' => __('To_shop shop')]; } public function getTypeList() { return ['0' => __('Type 0'), '1' => __('Type 1')]; } public function getIsTravelList() { return ['0' => __('Is_travel 0'), '1' => __('Is_travel 1')]; } public function getChooseSkillTypeList() { return ['0' => __('Choose_skill_type 0'), '1' => __('Choose_skill_type 1')]; } public function getSpecTypeList() { return ['0' => __('Spec_type 0'), '1' => __('Spec_type 1')]; } public function getShopStateList() { return ['0' => __('Shop_state 0'), '1' => __('Shop_state 1'), '-1' => __('Shop_state -1')]; } public function getStatusList() { return ['normal' => __('Status normal'), 'hidden' => __('Status hidden')]; } public function getToshopTextAttr($value, $data) { $value = $value ? $value : (isset($data['to_shop']) ? $data['to_shop'] : ''); $valueArr = explode(',', $value); $list = $this->getToshopList(); return implode(',', array_intersect_key($list, array_flip($valueArr))); } public function getIsTravelTextAttr($value, $data) { $value = $value ? $value : (isset($data['is_travel']) ? $data['is_travel'] : ''); $list = $this->getIsTravelList(); return isset($list[$value]) ? $list[$value] : ''; } public function getChooseSkillTypeTextAttr($value, $data) { $value = $value ? $value : (isset($data['choose_skill_type']) ? $data['choose_skill_type'] : ''); $list = $this->getChooseSkillTypeList(); return isset($list[$value]) ? $list[$value] : ''; } public function getTypeTextAttr($value, $data) { $value = $value ? $value : (isset($data['type']) ? $data['type'] : ''); $list = $this->getTypeList(); return isset($list[$value]) ? $list[$value] : ''; } public function getSpecTypeTextAttr($value, $data) { $value = $value ? $value : (isset($data['spec_type']) ? $data['spec_type'] : ''); $list = $this->getSpecTypeList(); return isset($list[$value]) ? $list[$value] : ''; } public function getShopStateTextAttr($value, $data) { $value = $value ? $value : (isset($data['shop_state']) ? $data['shop_state'] : ''); $list = $this->getShopStateList(); 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] : ''; } /** * 获取选取服务项目 * @param $ids * @return string */ public function getGoodsList($ids) { if(!$ids) { return ''; } $idArr = explode(',',$ids); $list = []; foreach ($idArr as $val) { $name = $this->where(['id'=>$val])->value('name'); if($name) { $list[] = $name; } } return implode(',',$list); } }