getPk(); $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]); }); } public function getEnabledmarkList() { return ['1' => __('Enabledmark 1'), '0' => __('Enabledmark 0')]; } public function getEnabledmarkTextAttr($value, $data) { $value = $value ? $value : $data['enabledmark']; $list = $this->getEnabledmarkList(); return isset($list[$value]) ? $list[$value] : ''; } // public function getCustomerTree() // { // $customerList = collection(model('StockCustomer')->select())->toArray(); // Tree::instance()->init($customerList); // $customer = []; // $this->customerList = Tree::instance()->getTreeList(Tree::instance()->getTreeArray(0), 'name'); // $primary = array(array('name'=>'==请选择上级==','id'=>'')); // $result = array_merge_recursive($primary, $this->customerList); // foreach ($result as $k => $v) { // $customer[$v['id']] = $v['name']; // } // return $customer; // } }