update($update); } } /** * 更新需求属性信息 * * @return mixed */ public function attrUpdate($id, $name, $data) { print_r($data);die; foreach ($data as $k => $v) { } } /** * 显示需求信息 * * @return mixed */ public function info($id) { $info = Dever::db('res/info')->one($id); if ($info) { $table['编号'] = $info['id']; $table['标题'] = $info['name']; $table['分类'] = Dever::load("category/api.string", $info['category']); if ($info['pic_cover']) { $table['封面图'] = ''; } if ($info['uid'] > 0) { $user = Dever::load('passport/user-one', $info['uid']); $table['创建人'] = $user['username'] . '(UID:'.$info['uid'].')'; if ($poster_pay_type == 1) { //$table['支付状态'] = ''; } } //$table['属性'] = $this->attrInfo($info); if ($info['cdate']) { $table['发布时间'] = date("Y-m-d H:i:s", $info['cdate']); } } return Dever::table($table); } private function attrInfo($info) { $table = array(); $info = Info::init($info['top_category_id']); if ($info) { $info = $info->info($info, 'id'); if ($info && isset($info['attr'])) { foreach ($info['attr'] as $k => $v) { $table[$v['name']] = $v['value_string']; } } } return Dever::table($table); } public function area($id, $name, $data) { # 不再执行syncone等后续操作 Dever::config('base')->after = 1; $type = Dever::input('type'); $area = Dever::param('area', $data); if ($area) { if (isset($area[2])) { $update['district_id'] = $area[2]; } if (isset($area[1])) { $update['city_id'] = $area[1]; } if (isset($area[0])) { $update['province_id'] = $area[0]; } if (isset($update)) { $update['where_id'] = $id; Dever::db($type . '/info')->update($update); } } } }