示例#1
0
 protected function _after_find(&$data, $options)
 {
     $data['county'] = D('District')->getNameById($data['county']);
     $data['focus'] = getFileUrl($data['focus'], '200-200');
     $data['tags'] = array_diff(explode('|', $data['tags']), array(''));
     $data['style'] = $this->getOptions('style', $data['style']);
 }
示例#2
0
 protected function _after_find(&$resultSet, $options)
 {
     $resultSet['fid_img'] = getFileUrl($resultSet['fid']);
     $resultSet['fid_img_thumb'] = getFileUrl($resultSet['fid'], '80-80');
     $resultSet['nickname'] = D('user')->where(array('id' => $resultSet['uid']))->getField('nickname');
     $resultSet['createtime_format'] = date('Y-m-d', $resultSet['createtime']);
 }
示例#3
0
 protected function _after_find(&$resultSet, $options)
 {
     $resultSet['type_zh'] = $this->_aBaseOptions['userType'][$resultSet['type']];
     $resultSet['reg_ip_zh'] = long2ip($resultSet['reg_ip']);
     $resultSet['header'] = getFileUrl($resultSet['avatar']);
     $resultSet['idcard'] = getFileUrl($resultSet['idcard']);
 }
示例#4
0
 protected function _after_select(&$resultSet, $options)
 {
     foreach ($resultSet as &$value) {
         //缩略图
         $value['thumb'] = getFileUrl($value['fid'], '80-80');
         $value['pic'] = getFileUrl($value['fid']);
     }
 }
示例#5
0
 protected function _after_select(&$resultSet, $options)
 {
     foreach ($resultSet as &$value) {
         $avatar = D('User')->where(array('id' => $value['owner_uid']))->getField('avatar');
         $value['owner_uid'] = getFileUrl($avatar, '30-30');
         $value['createtime'] = $this->time_tran($value['createtime']);
     }
 }
 protected function _after_select(&$resultSet, $options)
 {
     foreach ($resultSet as &$value) {
         $this->_auto_process_data($value);
         $value['pic'] = getFileUrl($value['pic'], '80-80');
         $value['createtime'] = date('Y-m-d H:i', $value['createtime']);
     }
 }
示例#7
0
 protected function _after_select(&$resultSet, $options)
 {
     foreach ($resultSet as &$value) {
         $value['fid_o'] = $value['fid'];
         $value['fid'] = getFileUrl($value['fid'], '80-80');
         $value['createtime'] = date('Y-m-d H:i', $value['createtime']);
     }
 }
示例#8
0
 public function index()
 {
     $aCom = (array) $this->oCom;
     $aCom['logo'] = getFileUrl($aCom['logo']);
     $this->assign('com', $aCom);
     $basewhere = $this->getPurviewCondition();
     $this->assign('num', D('Reserve')->getUndealCount($basewhere));
     $this->display();
 }
 public function edit()
 {
     $data = $this->model->getById(getRequest('id'));
     if ($this->isPost()) {
         $this->_edit($data, array(), $returl);
     } else {
         $data['pic'] = getFileUrl($data['pic'], '80-80');
         $this->_display_form($data);
     }
 }
示例#10
0
 protected function _after_select(&$resultSet, $options)
 {
     foreach ($resultSet as &$value) {
         //$value['fid_o'] = $value['fid'];
         $value['fid'] = getFileUrl($value['fid'], '88-88');
         $value['type'] = $this->getOptions('type', $value['type']);
         $value['step'] = $this->getOptions('step', $value['step']);
         $value['createtime'] = date('Y-m-d H:i', $value['createtime']);
     }
 }
 public function edit()
 {
     $data = $this->model->getById(getRequest('id'));
     $data['pic'] = getFileUrl($data['pic']);
     if ($this->isPost()) {
         $this->_edit($data);
     } else {
         $this->_display_form($data, 'add');
     }
 }
示例#12
0
 public function edit()
 {
     $data = $this->model->getById(getRequest('id'));
     $this->checkPurviewData($data);
     if ($this->isPost()) {
         $this->_edit($data);
     } else {
         $data['focus'] = getFileUrl($data['focus'], '200-200');
         $this->_display_form($data);
     }
 }
示例#13
0
 public function upload()
 {
     $info = D('File')->upload('imgFile');
     $arr = array('error' => $info['status']);
     if ($info['status'] != 0) {
         $arr['message'] = $info['msg'];
     } else {
         $arr['url'] = getFileUrl($info['data']['fileid']);
     }
     die(json_encode($arr));
 }
示例#14
0
 protected function _after_find(&$resultSet, $options)
 {
     $data = D('User')->where(array('id' => $resultSet['uid']))->find();
     $resultSet = array_merge($data, $resultSet);
     $resultSet['header'] = getFileUrl($resultSet['avatar']);
     $resultSet['name_zh'] = $resultSet['nickname'] ? $resultSet['nickname'] : $resultSet['realname'];
     $resultSet['content'] = ubbReplace($resultSet['content']);
     $resultSet['createtime'] = date('Y-m-d h:i:s', $resultSet['createtime']);
     $resultSet['reply_arr'] = $this->replyFormat($resultSet['reply']);
     $resultSet['reply_c'] = sizeof($resultSet['reply_arr']);
 }
示例#15
0
 protected function _after_select(&$resultSet, $options)
 {
     foreach ($resultSet as &$value) {
         $this->_auto_process_data($value);
         $data = D('User')->getById($value['uid']);
         $value['account'] = $data['account'];
         $value['realname'] = $data['realname'];
         $value['nickname'] = $data['nickname'];
         $value['avatar'] = getFileUrl($data['avatar']);
         $value['createtime'] = date('Y-m-d H:i', $value['createtime']);
     }
 }
示例#16
0
 protected function _after_find(&$resultSet, $options)
 {
     $user = D('User');
     $res = $user->where(array('id' => $resultSet['sender']))->find();
     $resultSet['content'] = ubbReplace($resultSet['content']);
     $resultSet['name_zh'] = $res['nickname'] ? $res['nickname'] : $res['account'];
     $resultSet['header'] = getFileUrl($res['avatar']);
     $resultSet['time_zh'] = date('Y-m-d h:i:s', $resultSet['createtime']);
     if ($this->oUser['id'] > 0) {
         $resultSet['is_sender'] = $resultSet['sender'] == $this->oUser['id'] ? 1 : 0;
     }
 }
示例#17
0
 protected function _after_select(&$resultSet, $options)
 {
     foreach ($resultSet as &$value) {
         $value['ofid'] = getFileUrl($value['fid']);
         $length = strlen($value['ofid']);
         $start = substr($value['ofid'], 0, $length - 4);
         $end = substr($value['ofid'], $length - 4, $length - 1);
         $value['tfid'] = $start . '_88-88' . $end;
         $value['pfid'] = $start . '_200-200' . $end;
         $value['bfid'] = $start . '_540-340' . $end;
         $value['createtime'] = date('Y-m-d H:i', $value['createtime']);
     }
 }
示例#18
0
 public function edit()
 {
     $data = $this->model->getById(getRequest('id'));
     $this->checkPurviewData($data);
     if ($this->isPost()) {
         $this->_edit($data);
     } else {
         $data['focus'] = getFileUrl($data['focus'], '120-120');
         $data['observe_date'] = date('Y年m月d日', $data['observe_date']);
         $data['observe_end'] = date('Y年m月d日', $data['observe_end']);
         $this->_display_form($data, 'add');
     }
 }
示例#19
0
 protected function _after_find(&$resultSet, $options)
 {
     $data = D('User')->getById($resultSet['uid'], 'uid');
     $resultSet = array_merge($data, $resultSet);
     $resultSet['sex_zh'] = $this->_aBaseOptions['sex'][$resultSet['sex']];
     $resultSet['style_zh'] = $this->_aBaseOptions['style'][$resultSet['style']];
     $resultSet['name_zh'] = $resultSet['nickname'] ? $resultSet['nickname'] : $resultSet['realname'];
     $resultSet['decoration_type_zh'] = $this->_aBaseOptions['decorationType'][$resultSet['decoration_type']];
     $resultSet['housetype_zh'] = $this->_aBaseOptions['houseType'][$resultSet['housetype']];
     $resultSet['designation_zh'] = $this->_aBaseOptions['designation'][$resultSet['designation']];
     $resultSet['service_area'] = $this->_aBaseOptions['serviceArea'][$resultSet['service_area']];
     $resultSet['ischeck_zh'] = $this->_aBaseOptions['ischeck'][$resultSet['ischeck']];
     $resultSet['header'] = getFileUrl($resultSet['avatar']);
 }
示例#20
0
 protected function _after_find(&$resultSet, $options)
 {
     if (!empty($this->oCollect['active'])) {
         foreach ($this->oCollect['active'] as $i) {
             if ($i['target'] == $resultSet['id'] && $i['type'] == 3) {
                 $resultSet['is_collect'] = 1;
             }
         }
     }
     $resultSet['focus_img'] = getFileUrl($resultSet['focus']);
     $resultSet['picture'] = D('Picture')->where(array('type' => 1, 'target' => $resultSet['id']))->select();
     $resultSet['join_count'] = D('Active_partner')->where(array('type' => 1, 'aid' => $resultSet['id']))->count();
     $resultSet['info_j'] = infoFormat($resultSet['info'], 300);
 }
示例#21
0
 public function edit()
 {
     $data = (array) $this->oCom;
     if ($this->isPost()) {
         $newdata = $this->_edit($data, array(), '', true);
         if ($newdata !== false) {
             $_SESSION['company'] = array_merge($data, $newdata);
             $this->success('修改成功!');
         } else {
             $this->error('修改失败!');
         }
     } else {
         $data['logo'] = getFileUrl($data['logo'], '200-200');
         $this->_display_form($data);
     }
 }
示例#22
0
 public function edit()
 {
     $data = $this->model->getById(getRequest('id'));
     $this->checkPurviewData($data);
     $type = $data['type'];
     $target = $data['target'];
     if ($this->isPost()) {
         $url = $this->model->getListUrl($type, $target);
         $this->_edit($data, array(), $url);
     } else {
         $aTarget = $this->model->getTarget($type, $target);
         $tab = $this->model->getTabTitle($type, $target, $aTarget);
         $this->assign('tabTitle', $tab);
         $data['fid'] = getFileUrl($data['fid'], '80-80');
         $this->_display_form($data, 'add');
     }
 }
示例#23
0
 public function edit()
 {
     $data = (array) $this->oCom;
     if ($this->isPost()) {
         $newdata = $this->_edit($data, array(), '', true);
         if ($newdata !== false) {
             $_SESSION['company'] = array_merge($data, $newdata);
             D('User')->where(array('id' => $this->oUser->id))->save(array('avatar' => $_SESSION['company']['logo']));
             //echo D('User')->getLastSql();die;
             $this->success('修改成功!');
         } else {
             $this->error('修改失败!');
         }
     } else {
         $data['logo'] = getFileUrl($data['logo'], '120-120');
         $this->_display_form($data);
     }
 }
示例#24
0
 protected function _after_find(&$resultSet, $options)
 {
     $resultSet['tags_zh'] = $this->_aBaseOptions['tags'][$resultSet['tags']];
     $resultSet['focus_img'] = getFileUrl($resultSet['pic']);
     $resultSet['tag_zh'] = formatTag($resultSet['tags']);
     switch ($resultSet['type']) {
         case '1':
             $resultSet['case'] = D('Case')->where(array('id' => $resultSet['target']))->find();
             $resultSet['info'] = $resultSet['case']['info'];
             $resultSet['designer'] = D('User_designer')->where(array('uid' => $resultSet['case']['uid']))->find();
             $resultSet['header'] = $resultSet['designer']['header'];
             break;
         case '2':
             $resultSet['house'] = D('House')->where(array('id' => $resultSet['target']))->find();
             $resultSet['info'] = $resultSet['house']['info'];
             $resultSet['designer'] = D('User_designer')->where(array('uid' => $resultSet['case']['uid']))->find();
             $resultSet['header'] = $resultSet['designer']['header'];
             break;
     }
 }
示例#25
0
 protected function _after_find(&$resultSet, $options)
 {
     $resultSet['housetype_zh'] = $this->_aBaseOptions['housetype'][$resultSet['housetype']];
     $resultSet['style_zh'] = $this->_aBaseOptions['style'][$resultSet['style']];
     $resultSet['focus_img'] = getFileUrl($resultSet['focus']);
     $resultSet['header'] = getFileUrl($resultSet['uid']);
     if (!empty($this->oCollect['house'])) {
         foreach ($this->oCollect['house'] as $i) {
             if ($i['target'] == $resultSet['id'] && $i['type'] == 2) {
                 $resultSet['is_collect'] = 1;
             }
         }
     }
     $resultSet['info_j'] = infoFormat($resultSet['info']);
     $resultSet['picture'] = D('Picture')->where(array('type' => 3, 'target' => $resultSet['id']))->select();
     $resultSet['material'] = explode("\n", $resultSet['material']);
     $resultSet['owner_interview'] = json_decode($resultSet['owner_interview'], 1);
     $resultSet['designer_interview'] = json_decode($resultSet['designer_interview'], 1);
     $resultSet['cons_interview'] = json_decode($resultSet['cons_interview'], 1);
     $resultSet['jl_jump'] = "http://yijianli.com/house/index.php?s=/Case/detail/id/{$resultSet['jl_id']}";
 }
示例#26
0
 function reply()
 {
     switch ($this->para['type']) {
         case '1':
             $this->model = D('Case');
             break;
         case '2':
             $this->model = D('Designer');
             break;
         case '3':
             $this->model = D('Active');
             break;
         case '4':
             $this->model = D('House');
             break;
     }
     $case = $this->model->queryOne(array('uid' => $this->oUser['id'], 'target' => $this->para['target']));
     $this->model = D('Comment');
     #获取json格式的回复信息
     $res = $this->model->queryOne(array('id' => $this->para['id']));
     if (empty($case) && $this->oUser['id'] != $res['uid']) {
         $this->resultFormat(null, 0, '你没有对该评论回复的权限');
     }
     $reply = json_decode($res['reply']);
     if (!is_array($reply)) {
         $reply = array();
     }
     $data = array('uid' => $this->oUser['id'], 'header' => getFileUrl($this->oUser['avatar']), 'name_zh' => $this->oUser['nickname'] ? $this->oUser['nickname'] : $this->oUser['realname'], 'content' => $this->para['content'], 'createtime' => time());
     #向回复信息中追加数据
     array_push($reply, $data);
     $reply = json_encode($reply);
     $data = array('reply' => $reply);
     $where = array('id' => $this->para['id']);
     #保存更新后的回复信息
     $id = $this->model->update($data, $where);
     if (!$id) {
         $this->resultFormat(null, 0, 'SQL:' . $this->model->getLastSql());
     }
     $this->resultFormat(null, 1);
 }
示例#27
0
文件: test.php 项目: noikiy/yisheji
 public function index()
 {
     $aUser = D('User')->where(array())->select();
     foreach ($aUser as $value) {
         if ($value['type'] > 1) {
             if ($value['type'] == 2) {
                 $model = D('User_designer');
             } elseif ($value['type'] == 3) {
                 $model = D('Company');
             }
             $aCase = D('Case')->where(array('uid' => $value['id']))->order('recommend desc,createtime desc')->find();
             if (empty($aCase)) {
                 continue;
             }
             $aDer = $model->getById($value['id'], 'uid');
             $aCache = json_decode($aDer['cache'], true);
             $aCache['case'] = array('id' => $aCase['id'], 'name' => $aCase['name'], 'focus' => getFileUrl($aCase['focus']));
             $model->where(array('uid' => $value['id']))->data(array('cache' => json_encode($aCache)))->save();
             echo $model->getLastSql() . "<br/>";
         }
     }
 }
示例#28
0
 public function setUserRecommend($uid)
 {
     //查询用户 如果是设计师
     $aUser = D('User')->getById($uid);
     if ($aUser['type'] == 2) {
         $model = D('User_designer');
     } else {
         if ($aUser['type'] == 3) {
             $model = D('Company');
         } else {
             return;
         }
     }
     $aDer = $model->getById($uid, 'uid');
     //查询推荐的记录
     $aData = $this->where(array('uid' => $uid))->order('recommend desc,createtime desc')->find();
     //组装cache数组
     $aCache = json_decode($aDer['cache'], true);
     $aCache['case'] = array('id' => $aData['id'], 'name' => $aData['name'], 'focus' => getFileUrl($aData['focus']));
     $model->where(array('uid' => $uid))->data(array('cache' => json_encode($aCache)))->save();
     //更新cache字段
 }
示例#29
0
 protected function _after_find(&$resultSet, $options)
 {
     $data = D('User')->getById($resultSet['uid']);
     $resultSet = array_merge($data, $resultSet);
     $resultSet['sex_zh'] = $this->_aBaseOptions['sex'][$resultSet['sex']];
     $resultSet['style_zh'] = $this->_aBaseOptions['style'][$resultSet['style']];
     $resultSet['name_zh'] = $resultSet['nickname'] ? $resultSet['nickname'] : $resultSet['realname'] ? $resultSet['realname'] : $resultSet['account'];
     $resultSet['decoration_type_zh'] = $this->_aBaseOptions['decorationType'][$resultSet['decoration_type']];
     $resultSet['housetype_zh'] = $this->_aBaseOptions['houseType'][$resultSet['housetype']];
     $resultSet['designation_zh'] = $this->_aBaseOptions['designation'][$resultSet['designation']];
     $resultSet['service_area'] = $this->_aBaseOptions['serviceArea'][$resultSet['service_area']];
     $resultSet['ischeck_zh'] = $this->_aBaseOptions['ischeck'][$resultSet['ischeck']];
     $resultSet['header'] = getFileUrl($resultSet['avatar']);
     $resultSet['avg_score'] = ($resultSet['score_skill'] + $resultSet['score_service']) / 2;
     $resultSet['star_html'] = getStar($resultSet['avg_score']);
     $resultSet['info_j'] = infoFormat($resultSet['info']);
     $resultSet['is_friend'] = D('Friend')->isFriend($resultSet['uid']);
     $cache = json_decode($resultSet['cache'], 1);
     $resultSet['friend_c'] = $cache['friend_count'] ? $cache['friend_count'] : 0;
     $resultSet['fensi_c'] = $cache['fensi_count'] ? $cache['fensi_count'] : 0;
     $resultSet['case_focus'] = $cache['case']['focus'] ? $cache['case']['focus'] : C('HOST_URL') . C('TMPL_PARSE_STRING.__FILES__') . "/404.jpg";
     $resultSet['case_id'] = $cache['case']['id'];
 }
示例#30
0
 protected function _after_find(&$resultSet, $options)
 {
     $resultSet['housetype_zh'] = $this->_aBaseOptions['houseType'][$resultSet['housetype']];
     $resultSet['style_zh'] = $this->_aBaseOptions['style'][$resultSet['style']];
     $resultSet['authorize_zh'] = $this->_aBaseOptions['authorize'][$resultSet['authorize']];
     $resultSet['focus_img'] = getFileUrl($resultSet['focus']);
     $resultSet['name'] = str_replace("\\'", "'", $resultSet['name']);
     $user = D('User')->getById($resultSet['uid']);
     if ($user['type'] == 2) {
         $designer = D('User_designer')->where(array('uid' => $resultSet['uid']))->find();
         $resultSet['user'] = $designer;
         $resultSet['user']['name_zh'] = $designer['realname'] ? $designer['realname'] : $designer['nickname'];
         $resultSet['user']['url'] = __GROUP__ . "/Designer/designerDetails/uid/" . $designer['uid'];
     } else {
         if ($user['type'] == 3) {
             $company = D('Company')->where(array('uid' => $resultSet['uid']))->find();
             $resultSet['user'] = $company;
             $resultSet['user']['name_zh'] = $company['name'];
             $resultSet['user']['url'] = __GROUP__ . "/Company/companyDetails/uid/" . $company['uid'];
         }
     }
     $resultSet['user']['type'] = $user['type'];
     $resultSet['user']['header'] = getFileUrl($user['avatar']);
     $resultSet['tag_zh'] = formatTag($resultSet['tags']);
     $resultSet['is_original_zh'] = $resultSet['is_original'] ? '原创' : '转发';
     $resultSet['createtime_zh'] = time_tran($resultSet['createtime']);
     $resultSet['info_j'] = infoFormat($resultSet['info']);
     $resultSet['is_collect'] = 0;
     if (!empty($this->oCollect['case'])) {
         foreach ($this->oCollect['case'] as $i) {
             if ($i['target'] == $resultSet['id'] && $i['type'] == 1) {
                 $resultSet['is_collect'] = 1;
             }
         }
     }
 }