public function handle($request, Clousure $next) { if (!userAuth::check()) { return redirect::action('topm_ctl_passport@signin'); } return $next($request); }
public function handle($request, Clousure $next) { if (userAuth::check()) { return redirect::route('wap.home'); } return $next($request); }
public function __commonData($filter) { //$filter = input::get(); $promotionInfo = app::get('topm')->rpcCall('promotion.promotion.get', array('promotion_id' => $filter['promotion_id'])); if ($promotionInfo['valid']) { if (!$filter['pages']) { $filter['pages'] = 1; } $pageSize = 20; $params = array('page_no' => $pageSize * ($filter['pages'] - 1), 'page_size' => $pageSize, 'fields' => 'item_id,shop_id,title,image_default_id,price'); //获取促销商品列表 $promotionItem = $this->__promotionItemList($promotionInfo, $params); $count = $promotionItem['total_found']; $promotionItemList = $promotionItem['list']; if (userAuth::check()) { $pagedata['nologin'] = 1; } //处理翻页数据 $current = $filter['pages'] ? $filter['pages'] : 1; $filter['pages'] = time(); if ($count > 0) { $total = ceil($count / $pageSize); } $pagedata['pagers'] = array('link' => url::action('topm_ctl_promotion@getPromotionItem', $filter), 'current' => $current, 'total' => $total, 'token' => $filter['pages']); $pagedata['promotionInfo'] = $promotionItem['promotionInfo']; $pagedata['promotionItemList'] = $promotionItemList; $pagedata['count'] = $count; $pagedata['title'] = $promotionItem['promotionInfo']['promotion_tag']; $pagedata['promotiontype'] = $promotionInfo['promotion_type']; } else { return abort(404); } return $pagedata; }
public function __construct(&$app) { parent::__construct(); // 检测是否登录 if (!userAuth::check()) { redirect::action('topc_ctl_passport@signin')->send(); exit; } }
public function signup() { //如果已登录则跳转到退出页 if (userAuth::check()) { $this->logout(); } $pagedata['next_page'] = $this->__getFromUrl(); return $this->page('topm/passport/signup/signup.html', $pagedata); }
public function __construct(&$app) { parent::__construct(); // 检测是否登录 if (!userAuth::check()) { redirect::action('topm_ctl_passport@signin')->send(); exit; } $this->setLayoutFlag('cart'); }
public function signup() { //如果已登录则跳转到退出页 if (userAuth::check()) { $this->logout(); } $pagedata['next_page'] = $this->__getFromUrl(); $pagedata['license'] = app::get('sysuser')->getConf('sysuser.register.setting_user_license'); return $this->page('topc/passport/signup/signup.html', $pagedata); }
public function index() { $standardid = intval(input::get('standard_id')); // code... // $sprodrelease=$this->sprodrelease_model->getRow('*',array('standard_id'=>$standardid)); // $standard_items=$this->standard_item_model->getList('*',array('uniqid'=>$sprodrelease['uniqid'])); //交易信息 $sprodrelease = $this->sprodrelease_model->getRow('*', array('standard_id' => $standardid)); //交易商品信息 $standardSql = "select * from sysshoppubt_standard_item a\n left join sysshoppubt_sprodrelease b on a.uniqid=b.uniqid\n where b.standard_id = " . $standardid . ""; $standard_items = app::get("base")->database()->executeQuery($standardSql)->fetchAll(); $totalPrice = 0; $i = 0; foreach ($standard_items as $key => $val) { $item = $this->sysitem_item_model->getRow('*', array('item_id' => $val['item_id'])); $standard_items[$i]['list_image'] = explode(',', $item['list_image']); $standard_items[$i]['image_default_id'] = $item['image_default_id']; $standard_items[$i]['goods_total_price'] = $val['num'] * $val['net_price']; $standard_items[$i]["item"] = $item; $totalPrice = $totalPrice + $standard_items[$i]['goods_total_price']; $prop = app::get('syscategory')->model('item_prop_value')->getList("*", array("item_id" => $val['item_id'])); $standard_items[$i]["prop"] = $prop; $i++; } //卖方信息 $shopId = $sprodrelease["shop_id"]; $shopInfo = app::get("sysshop")->model("shop")->getRow("*", array("shop_id" => $shopId)); //购买记录 $tradeorderSql = "select * from sysshoppubt_tradeorder where standard_id=" . $standardid . " ORDER BY create_time desc LIMIT 4"; $tradeorderList = app::get("base")->database()->executeQuery($tradeorderSql)->fetchAll(); //返回信息 $pagedata['standard_items'] = $standard_items; // 商品详情 $pagedata['totalPrice'] = $totalPrice; //整个交易的总价 $pagedata['row'] = $sprodrelease; //交易信息 $pagedata['now_time'] = time(); //当前时间 $pagedata["shop"] = $shopInfo; $pagedata['type'] = 0; $pagedata["tradeList"] = $tradeorderList; if ($sprodrelease['seegoods_stime'] < time() && $sprodrelease['seegoods_stime'] != null) { $pagedata['sample_end'] = '1'; } elseif ($sprodrelease['seegoods_stime'] == null) { $pagedata['sample_end'] = '0'; } else { $pagedata['sample_end'] = '2'; } if (userAuth::check()) { $pagedata['nologin'] = 1; } return $this->page('topc/standard/index.html', $pagedata); }
public function __construct(&$app) { parent::__construct(); theme::setNoindex(); theme::setNoarchive(); theme::setNofolow(); theme::prependHeaders('<meta name="robots" content="noindex,noarchive,nofollow" />\\n'); $this->title = app::get('topm')->_('订单中心'); // 检测是否登录 if (!userAuth::check()) { redirect::action('topm_ctl_passport@signin')->send(); exit; } }
public function __construct(&$app) { parent::__construct(); kernel::single('base_session')->start(); if (!$this->action) { $this->action = 'index'; } $this->action_view = $this->action . ".html"; // 检测是否登录 if (!userAuth::check()) { redirect::action('topc_ctl_passport@signin')->send(); exit; } $this->limit = 20; $this->passport = kernel::single('topc_passport'); }
public function index() { $trandeid = intval(input::get('trande_id')); # code... $trandeItem = app::get("sysshoppubt")->model("tender")->getRow("*", array("trande_id" => $trandeid)); $trandeItemList = app::get("sysshoppubt")->model("standard_item")->getList("*", array("uniqid" => $trandeItem['uniqid'])); $pagedata["requireItem"] = $trandeItem; $pagedata["itemList"] = $trandeItemList; if (userAuth::check()) { $pagedata['nologin'] = 1; } $article_id = "122"; $artList = app::get("syscontent")->model("article")->getList("*", array('article_id' => $article_id)); $pagedata["tender"] = $artList[0]['content']; return $this->page('topc/trande/index.html', $pagedata); }
public function index() { $shopId = input::get('shop_id'); $pagedata = $this->__common($shopId); if (userAuth::check()) { $pagedata['nologin'] = 1; } //店铺自定义区域 $params = shopWidgets::getWidgetsData('custom', $shopId); if ($params) { $pagedata['params'] = $params['custom']; } //店铺商品 $items = shopWidgets::getWidgetsData('showitems', $shopId, '0,1'); if ($items) { $itemIds = array(); foreach ($items as $row) { $itemIds = array_merge($itemIds, array_column($row, 'item_id')); } $activityParams['item_id'] = implode(',', array_unique($itemIds)); $activityParams['status'] = 'agree'; $activityParams['end_time'] = 'bthan'; $activityParams['start_time'] = 'sthan'; $activityParams['fields'] = 'activity_id,item_id,activity_tag,price,activity_price'; $activityItemList = app::get('topc')->rpcCall('promotion.activity.item.list', $activityParams); if ($activityItemList) { $activatyItem = array_bind_key($activityItemList['list'], 'item_id'); foreach ($items as &$row) { foreach ($row as &$item) { if ($activatyItem[$item['item_id']]) { $item['activity_tag'] = $activatyItem[$item['item_id']]['activity_tag']; $item['price'] = $activatyItem[$item['item_id']]['activity_price']; } } } } } $pagedata['items'] = $items; // 店铺优惠券信息, $params = array('page_no' => 0, 'page_size' => 10, 'fields' => '*', 'shop_id' => $shopId, 'platform' => 'pc', 'is_cansend' => 1); $couponListData = app::get('topc')->rpcCall('promotion.coupon.list', $params, 'buyer'); $pagedata['homeCouponList'] = $couponListData['coupons']; $pagedata['file'] = "topc/shop/center.html"; return $this->page('topc/shop/index.html', $pagedata); }
public function index() { $supplyId = intval(input::get('supply_id')); # code... $type = intval(input::get('type')); # code... if (empty($supplyId)) { return redirect::action('topc_ctl_default@index'); } if (userAuth::check()) { $pagedata['nologin'] = 1; } $supplyItem = app::get("sysspfb")->model("supplyInfo")->getRow("*", array("supply_id" => $supplyId)); $list_image2 = array(); //判断当前供求信息是否为当前登录人发布的 $userId = userAuth::id(); if ($userId == $supplyItem["user_id"]) { $pagedata['myreqsupp'] = 1; } $list_image = explode(",", $supplyItem["list_image"]); foreach ($list_image as $key => $value) { if ($key < count($list_image) - 1) { array_push($list_image2, $value); } } //var_dump($list_image2); $supplyItem['list_image'] = $list_image2; //企业信息 $userid = $supplyItem["user_id"]; $params["user_id"] = $userid; $shopInfo = app::get('topc')->rpcCall('shop.get.shopInfo', $params, 'buyer'); $pagedata["requireItem"] = $supplyItem; $pagedata["type"] = $type; $pagedata["shopinfo"] = $shopInfo; //查询是否有询价信息 $enquireinfolist = app::get("sysspfb")->model("enquireinfo")->getList("*", array("reqsupp_id" => $supplyId, "ifrequire" => 1, "user_id" => $userId)); $pagedata["enquireinfolist"] = $enquireinfolist; $this->setLayoutFlag('supply'); // var_dump( $type); return $this->page('topc/items/index.html', $pagedata); }
public function detail() { if (userAuth::check()) { $pagedata['nologin'] = 1; } $this->setLayoutFlag('product'); $post = input::get(); $params['fields'] = "*"; $params['activity_id'] = $post['a']; $params['item_id'] = $post['g']; $groupItem = app::get('topm')->rpcCall('promotion.activity.item.info', $params); if ($groupItem['activity_info']['release_time'] > time()) { redirect::action('topm_ctl_item@index', array('item_id' => $params['item_id']))->send(); exit; } $pagedata['group_item'] = $groupItem; $pagedata['item'] = app::get('topm')->rpcCall('item.get', array('item_id' => $params['item_id'], 'fields' => 'item_count.sold_quantity,item_count.item_id')); $pagedata['shop'] = app::get('topm')->rpcCall('shop.get', array('shop_id' => $pagedata['group_item']['shop_id'], 'fields' => 'shop_name,shop_id')); $pagedata['now_time'] = time(); $pagedata['shopDsrData'] = $this->__getShopDsr($pagedata['shop']['shop_id']); return $this->page("topm/shop/promotion/activity_detail.html", $pagedata); }
public function index() { $itemId = intval(input::get('item_id')); if (empty($itemId)) { return redirect::action('topc_ctl_default@index'); } if (userAuth::check()) { $pagedata['nologin'] = 1; } $pagedata['user_id'] = userAuth::id(); $pagedata['image_default_id'] = $this->__setting(); $params['item_id'] = $itemId; $params['fields'] = "*,item_desc.pc_desc,item_count,item_store,item_status,sku,item_nature,spec_index"; $detailData = app::get('topc')->rpcCall('item.get', $params); if (!$detailData) { $pagedata['error'] = "很抱歉,您查看的宝贝不存在,可能已下架或者被转移"; return $this->page('topc/items/error.html', $pagedata); } if (count($detailData['sku']) == 1) { $detailData['default_sku_id'] = array_keys($detailData['sku'])[0]; } $detailData['valid'] = $this->__checkItemValid($detailData); //判断此商品发布的平台,如果是wap端,跳转至wap链接 if ($detailData['use_platform'] == 2) { redirect::action('topm_ctl_item@index', array('item_id' => $itemId))->send(); exit; } //相册图片 if ($detailData['list_image']) { $detailData['list_image'] = explode(',', $detailData['list_image']); } //获取商品的促销信息 $promotionDetail = app::get('topc')->rpcCall('item.promotiontag.get', array('item_id' => $itemId)); if ($promotionDetail) { $promotionIds = explode(',', $promotionDetail['promotion_ids']); foreach ($promotionIds as $promotionId) { $basicPromotionInfo = app::get('topc')->rpcCall('promotion.promotion.get', array('promotion_id' => $promotionId, 'platform' => 'pc')); if ($basicPromotionInfo['valid'] === true) { $pagedata['promotionDetail'][$promotionId] = $basicPromotionInfo; } } } $pagedata['promotion_count'] = count($pagedata['promotionDetail']); // 活动促销(如名字叫团购) $activityDetail = app::get('topc')->rpcCall('promotion.activity.item.info', array('item_id' => $itemId, 'valid' => 1), 'buyer`'); if ($activityDetail) { $pagedata['activityDetail'] = $activityDetail; } $detailData['spec'] = $this->__getSpec($detailData['spec_desc'], $detailData['sku']); $detailData['qrCodeData'] = $this->__qrCode($itemId); $pagedata['item'] = $detailData; //获取商品详情页左侧店铺分类信息 $pagedata['shopCat'] = app::get('topc')->rpcCall('shop.cat.get', array('shop_id' => $pagedata['item']['shop_id'])); //获取该商品的店铺信息 $pagedata['shop'] = app::get('topc')->rpcCall('shop.get', array('shop_id' => $pagedata['item']['shop_id'])); //获取该商品店铺的DSR信息 $pagedata['shopDsrData'] = $this->__getShopDsr($pagedata['item']['shop_id']); $pagedata['next_page'] = url::action("topc_ctl_item@index", array('item_id' => $itemId)); if ($pagedata['user_id']) { //获取该用户的最近购买记录 $pagedata['buyerList'] = app::get('topc')->rpcCall('trade.user.buyerList', array('user_id' => $pagedata['user_id'])); } //设置此页面的seo $brand = app::get('topc')->rpcCall('category.brand.get.info', array('brand_id' => $detailData['brand_id'])); $cat = app::get('topc')->rpcCall('category.cat.get.info', array('cat_id' => $detailData['cat_id'])); $seoData = array('item_title' => $detailData['title'], 'shop_name' => $pagedata['shop']['shop_name'], 'item_brand' => $brand['brand_name'], 'item_bn' => $detailData['bn'], 'item_cat' => $cat[$detailData['cat_id']]['cat_name'], 'sub_title' => $detailData['sub_title']); seo::set('topc.item.detail', $seoData); //echo '<pre>';print_r($pagedata);exit(); return $this->page('topc/items/index.html', $pagedata); }
private function __getItems($postdata) { $objLibFilter = kernel::single('topm_item_filter'); $params = $objLibFilter->decode($postdata); $params['use_platform'] = '0,2'; //判断自营 自营是1,非自营是0 if ($params['is_selfshop'] == '1') { $pagedata['isself'] = '0'; } else { $pagedata['isself'] = '1'; } //如果不是从分类进入,并且没有关键字搜索则不能进入列表页 $params['search_keywords'] = trim($params['search_keywords']); if (empty($params['cat_id']) && empty($params['search_keywords'])) { return false; } //默认图片 $pagedata['image_default_id'] = app::get('image')->getConf('image.set'); //搜索或者筛选获取商品 $searchParams = $this->__preFilter($params); $searchParams['fields'] = 'item_id,title,image_default_id,price'; $itemsList = app::get('topm')->rpcCall('item.search', $searchParams); //检测是否有参加团购活动 if ($itemsList['list']) { $itemsList['list'] = array_bind_key($itemsList['list'], 'item_id'); $itemIds = array_keys($itemsList['list']); $activityParams['item_id'] = implode(',', $itemIds); $activityParams['status'] = 'agree'; $activityParams['end_time'] = 'bthan'; $activityParams['start_time'] = 'sthan'; $activityParams['fields'] = 'activity_id,item_id,activity_tag,price,activity_price'; $activityItemList = app::get('topc')->rpcCall('promotion.activity.item.list', $activityParams); if ($activityItemList['list']) { foreach ($activityItemList['list'] as $key => $value) { $itemsList['list'][$value['item_id']]['activity'] = $value; $itemsList['list'][$value['item_id']]['price'] = $value['activity_price']; } } } $pagedata['items'] = $itemsList['list']; //根据条件搜索出的商品 //根据条件搜索出最多商品的分类,进行显示渐进式筛选项 $filterItems = app::get('topm')->rpcCall('item.search.filterItems', $params); //渐进式筛选的数据 $pagedata['screen'] = $filterItems; $pagedata['count'] = $itemsList['total_found']; //根据条件搜索到的总数 //已有的搜索条件 $tmpFilter = $params; unset($tmpFilter['pages']); $pagedata['filter'] = $objLibFilter->encode($tmpFilter); //已选择的搜索条件 $pagedata['activeFilter'] = $params; //分页 $pagedata['pagers'] = $this->__pages($params['pages'], $pagedata['count'], $pagedata['filter']); if (userAuth::check()) { $pagedata['nologin'] = 1; } return $pagedata; }
public function index() { //$this->setLayoutFlag('shopcenter'); $shopId = input::get('shop_id'); if ($shopId) { $shopdata = app::get("sysshop")->model("shop")->getRow("*", array("shop_id" => $shopId)); $is_open = $shopdata["status"]; $is_center = $shopdata["is_shopcenter"]; $pagedata = $this->__common($shopId); if (userAuth::check()) { $pagedata['nologin'] = 1; } //企业自定义区域 // $params = shopWidgets::getWidgetsData('custom',$shopId); // if($params) // { // $pagedata['params'] = $params['custom']; // } $a = $pagedata['shopdata']; $b = 1; if ($is_open == "active" && $is_center == "1") { return $this->page('topc/shop/index.html', $pagedata); } } else { return $this->splash('error', null, "请先完善企业入驻信息!"); } }
public function index() { $bidddingId = intval(input::get('bidding_id')); # code... $this->bidding_model = app::get('sysshoppubt')->model('biddings'); $comment = app::get('sysshoppubt')->model('comment'); if (empty($bidddingId)) { return redirect::action('topc_ctl_default@index'); } if (userAuth::check()) { $pagedata['nologin'] = 1; } //交易详情信息 $biddingItem = app::get("sysshoppubt")->model("biddings")->getRow("*", array("bidding_id" => $bidddingId)); $tradeorder = app::get("sysshoppubt")->model("tradeorder")->getRow("*", array("bidding_id" => $bidddingId, 'state' => 1)); //企业信息 $shopId = $biddingItem["shop_id"]; $shopinfo = app::get("sysshop")->model("shop")->getRow("*", array("shop_id" => $shopId)); //其他竞价 $otherSql = "select a.bidding_id,a.trading_title,max(c.image_default_id) image_default_id from sysshoppubt_biddings a LEFT JOIN sysshoppubt_standard_item b\n on a.uniqid=b.uniqid\n left join sysitem_item c on b.item_id=c.item_id\n WHERE a.bidding_id<>" . $bidddingId . "\n group by 1,2"; $otherList = app::get("base")->database()->executeQuery($otherSql)->fetchAll(); $pagedata["shopinfo"] = $shopinfo; $pagedata['otherList'] = $otherList; $tradSql = "select tradeorder_id,totalbid from sysshoppubt_tradeorder where bidding_id=" . $bidddingId . " order by totalbid desc"; $tradeorderListall = app::get("base")->database()->executeQuery($tradSql)->fetchAll(); $pagedata["tendercount"] = count($tradeorderListall); $tradeorderList = array_slice($tradeorderListall, 0, 1); if ($tradeorderList) { $pagedata["b_price_type"] = "1"; $pagedata["totalbid"] = $tradeorderList[0]["totalbid"]; $tradeorder_id = $tradeorderList[0]["tradeorder_id"]; $itemSql = "select a.*,c.bid,d.image_default_id from sysshoppubt_standard_item a \n left join sysshoppubt_biddings b on a.uniqid = b.uniqid \n left join (select item_id,bid from sysshoppubt_torderitem where tradeorder_id = " . $tradeorder_id . ") c on a.item_id=c.item_id\n left join sysitem_item d on a.item_id=d.item_id \n where b.bidding_id=" . $bidddingId . ""; $biddingItemList = app::get("base")->database()->executeQuery($itemSql)->fetchAll(); $pagedata["itemList"] = $biddingItemList; } else { $pagedata["b_price_type"] = "0"; $pagedata["totalbid"] = 0; $biddingItemList = app::get("sysshoppubt")->model("standard_item")->getList("*", array("uniqid" => $biddingItem['uniqid'])); foreach ($biddingItemList as $key => $value) { $biddingItemList[$key]["bid"] = 0; $itemid = $value["item_id"]; $itemRow = app::get('sysitem')->model('item')->getRow("*", array("item_id" => $itemid)); $biddingItemList[$key]["image_default_id"] = $itemRow["image_default_id"]; $prop = app::get('syscategory')->model('item_prop_value')->getList("*", array("item_id" => $itemid)); $biddingItemList[$key]["prop"] = $prop; # code... } $pagedata["itemList"] = $biddingItemList; } $pagedata["requireItem"] = $biddingItem; $pagedata['tradeorder'] = $tradeorder; //弹出层 $article_id = "1"; $artList = app::get("syscontent")->model("article")->getList("*", array('article_id' => $article_id)); $pagedata["artList"] = $artList[0]['content']; $article_id = "2"; $artList = app::get("syscontent")->model("article")->getList("*", array('article_id' => $article_id)); $pagedata["dialogPrice"] = $artList[0]['content']; //详细页右侧信息 $tradSqlPm = "select user_name,tradeorder_id,totalbid from sysshoppubt_tradeorder where bidding_id=" . $bidddingId . " order by totalbid desc LIMIT 4"; $pmList = app::get("base")->database()->executeQuery($tradSqlPm)->fetchAll(); $pagedata["pm"] = $pmList; //看样 $bidding = $this->bidding_model->getRow('*', array('bidding_id' => $bidddingId)); $pagedata['rows'] = $bidding; $pagedata['type'] = 1; if ($bidding['seegoods_stime'] < time() && $bidding['seegoods_stime'] != null) { $pagedata['sample_end'] = '1'; } elseif ($bidding['seegoods_stime'] == null) { $pagedata['sample_end'] = '0'; } else { $pagedata['sample_end'] = '2'; } $starttime = $bidding['start_time'] - time(); $stoptime = $bidding['stop_time'] - time(); if ($bidding['start_time'] > time() && $bidding['isok'] != 1) { $pagedata['state'] = 0; $pagedata['totaltime'] = $starttime; } elseif ($bidding['stop_time'] > time() && $bidding['isok'] != 1) { $pagedata['state'] = 1; $pagedata['totaltime'] = $stoptime; } else { $pagedata['state'] = 2; $pagedata['totaltime'] = 0; } $commentnum = $comment->count(array('shop_id' => $shopId, 'item_id' => $bidddingId)); $pagedata['commentnum'] = $commentnum; $this->setLayoutFlag('bidding'); return $this->page('topc/bidding/index.html', $pagedata); }
private function __getItems($data) { $objLibFilter = kernel::single('topm_item_filter'); $params = $objLibFilter->decode($data); $params['use_platform'] = '0'; if ($params['shop_id']) { $pagedata['shopCat'] = $shopCat = app::get('topm')->rpcCall('shop.cat.get', array('shop_id' => $params['shop_id'])); } if ($params['shop_cat_id'] && $shopCat[$params['shop_cat_id']]) { $params['shop_cat_id'] = array_keys($shopCat[$params['shop_cat_id']]['children']); $params['shop_cat_id'] = implode(',', $params['shop_cat_id']); } //标签获取 if ($params['widgets_id'] && $params['widgets_type']) { $tagInfo = shopWidgets::getWapInfo($params['widgets_type'], $data['shop_id'], $data['widgets_id']); foreach ($tagInfo[0]['params']['item_id'] as $key => $value) { $item_id .= $value . ','; } $params['item_id'] = rtrim($item_id, ","); } $itemsList = $this->__search($params); $items = $itemsList['list']; $count = $itemsList['total_found']; $pagedata['items'] = $items; $pagedata['activeFilter'] = $params; $tmpFilter = $params; unset($tmpFilter['pages']); $pagedata['filter'] = $objLibFilter->encode($tmpFilter); $current = $params['pages'] ? $params['pages'] : 1; if ($count > 0) { $totalPage = ceil($count / $this->limit); } $pagedata['pagers'] = array('link' => url::action('topm_ctl_shopcenter@search', $params), 'current' => $current, 'total' => $totalPage <= $this->maxPages ? $totalPage : $this->maxPages); if (userAuth::check()) { $pagedata['nologin'] = 1; } return $pagedata; }
public function index() { $tenderId = intval(input::get('tender_id')); $comment = app::get('sysshoppubt')->model('comment'); $this->tender_model = app::get('sysshoppubt')->model('tender'); $this->standard_item_model = app::get('sysshoppubt')->model('standard_item'); $this->sysitem_item_model = app::get('sysitem')->model('item'); $this->tenderenter = app::get('sysshoppubt')->model('tenderenter'); $recorder = app::get('sysshoppubt')->model('moneyrecoder'); $this->setLayoutFlag('tender'); $tender = $this->tender_model->getRow('*', array('tender_id' => $tenderId)); $standard_items = $this->standard_item_model->getList('*', array('uniqid' => $tender['uniqid'])); foreach ($standard_items as $key => $value) { $item = $this->sysitem_item_model->getRow('*', array('item_id' => $value['item_id'])); $standard_items[$key]['goods_total_price'] = intval($value['num']) * intval($value['net_price']); $standard_items[$key]["image_default_id"] = $item["image_default_id"]; $prop = app::get('syscategory')->model('item_prop_value')->getList("*", array("item_id" => $value["item_id"])); $standard_items[$key]["prop"] = $prop; } $pagedata['standard_items'] = $standard_items; // 商品详情 $pagedata['row'] = $tender; //交易信息 $pagedata['type'] = 2; //企业信息 $shopId = $tender["shop_id"]; $shopinfo = app::get("sysshop")->model("shop")->getRow("*", array("shop_id" => $shopId)); $pagedata["shopinfo"] = $shopinfo; //已投标 $tendetenterList = $this->tenderenter->getList("*", array("tender_id" => $tenderId)); $tenderentercount = count($tendetenterList); $pagedata["tendetenterList"] = $tendetenterList; $pagedata["tenderentercount"] = $tenderentercount; if ($tender['seegoods_stime'] < time() && $tender['seegoods_stime'] != null) { $pagedata['sample_end'] = '1'; } elseif ($tender['seegoods_stime'] == null) { $pagedata['sample_end'] = '0'; } else { $pagedata['sample_end'] = '2'; } if (userAuth::check()) { $pagedata['nologin'] = 1; } if (userAuth::id()) { $params["user_id"] = userAuth::id(); $shopInfoGet = app::get('topc')->rpcCall('shop.get.shopInfo', $params, 'buyer'); $pagedata['result'] = $recorder->getRow('*', array('shop_id' => $shopId, 'type' => 0, 'item_id' => $tenderId, 'user_id' => $shopInfoGet['shop_id'])); $pagedata['tenderinfoment'] = $this->tenderenter->getRow('*', array('shop_id' => $shopId, 'tender_man_id' => $shopInfoGet['shop_id'], 'tender_id' => $tenderId)); } $starttime = $tender['start_time'] - time(); $stoptime = $tender['stop_time'] - time(); if ($tender['start_time'] > time() && $tender['isok'] != 1) { $pagedata['state'] = 0; $pagedata['totaltime'] = $starttime; } elseif ($tender['stop_time'] > time() && $tender['isok'] != 1) { $pagedata['state'] = 1; $pagedata['totaltime'] = $stoptime; } else { $pagedata['state'] = 2; $pagedata['totaltime'] = 0; } $commentnum = $comment->count(array('shop_id' => $shopId, 'item_id' => $tenderId)); $pagedata['commentnum'] = $commentnum; return $this->page('topc/tender/index.html', $pagedata); }