public function handle($request, Clousure $next) { if (!userAuth::check()) { return redirect::action('topm_ctl_passport@signin'); } return $next($request); }
/** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(CreateBookRequest $request) { $user = \Auth::User(); if (!$user) { return view('auth.login')->withErrors('You are not loged in, please loged in !'); } $book = $request->bookFillData(); $book['user_id'] = $user->id; $book['published_at'] = Carbon::parse($request->get('published_at'))->format('Y-m-d'); $fileSizeValidation = \Config::get('library.image_file_size'); $newBook = Book::create($book); $newBook->syncAuthors($request->get('authors')); $this->manager->createDirectory($newBook->id); $file = $_FILES['image']; if ($file['size'] > 0) { // Additional image validation if (!starts_with($file['type'], 'image/')) { return Redirect::action('BookController@create')->withErrors('Invalid file format, please use image !'); } $fileSize = $file['size'] / 1024; if ($fileSize > $fileSizeValidation) { return Redirect::action('BookController@create')->withErrors('The image may not be greater than ' . $fileSizeValidation . ' kilobytes. '); } $img = Image::make($_FILES['image']['tmp_name']); $img->resize(140, 140); $img->save('.' . \Config::get('library.uploads.webpath') . DIRECTORY_SEPARATOR . $newBook->id . '/cover.jpg'); } return redirect::action('BookController@index')->withSuccess("The book with title '{$newBook->title}' was created."); }
public function applyForOpen() { $shopId = $this->shopId; $requestParams = ['shop_id' => $shopId]; $res = app::get('topshop')->rpcCall('open.shop.develop.apply', $requestParams); redirect::action('topshop_ctl_open@index')->send(); exit; }
public function __construct(&$app) { parent::__construct(); // 检测是否登录 if (!userAuth::check()) { redirect::action('topc_ctl_passport@signin')->send(); exit; } }
public function __construct(&$app) { parent::__construct(); // 检测是否登录 if (!userAuth::check()) { redirect::action('topm_ctl_passport@signin')->send(); exit; } $this->setLayoutFlag('cart'); }
public function goAftersalesDetail() { $params['oid'] = input::get('id'); $params['fields'] = 'aftersales_bn'; $result = app::get('topm')->rpcCall('aftersales.get.bn', $params); if (is_null($result)) { redirect::action('topm_ctl_member_trade@tradeList')->send(); exit; } redirect::action('topm_ctl_member_aftersales@aftersalesDetail', array('id' => $result['aftersales_bn']))->send(); exit; }
public function handle($request, Clousure $next) { //获取shopInfo $sellerId = pamAccount::getAccountId(); $shopId = app::get('topshop')->rpcCall('shop.get.loginId', array('seller_id' => $sellerId), 'seller'); $requestParams = ['shop_id' => $shopId]; $shopConf = app::get('topshop')->rpcCall('open.shop.develop.conf', $requestParams); if ($shopConf['develop_mode'] == 'DEVELOP') { return redirect::action('topshop_ctl_index@nopermission'); } return $next($request); }
public function handle($request, Clousure $next) { //获取shopInfo $sellerId = pamAccount::getAccountId(); $shopId = app::get('topshop')->rpcCall('shop.get.loginId', array('seller_id' => $sellerId), 'seller'); //获取商铺信息 $requestParams = ['shop_id' => $shopId, 'fields' => 'shop_id,shop_name,shop_type']; $shopInfo = app::get('topshop')->rpcCall('shop.get', $requestParams); if ($shopInfo['shop_type'] != 'self') { return redirect::action('topshop_ctl_index@onlySelfManagement'); } return $next($request); }
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 index() { $keyword = input::get('keyword'); $searchType = input::get('searchtype'); if (!empty($keyword)) { if ($searchType == 'shop') { return redirect::action('topc_ctl_shopcenter@search', array('n' => $keyword)); } else { return redirect::action('topc_ctl_list@index', array('n' => $keyword)); } } else { return redirect::back(); } }
public function detail() { $params['aftersales_bn'] = input::get('bn'); $params['shop_id'] = $this->shopId; $tradeFields = 'trade.status,trade.receiver_name,trade.user_id,trade.post_fee,trade.receiver_state,trade.receiver_city,trade.created_time,trade.receiver_district,trade.receiver_address,trade.receiver_mobile,trade.receiver_phone'; $params['fields'] = 'aftersales_bn,shop_id,aftersales_type,sendback_data,sendconfirm_data,shop_explanation,admin_explanation,user_id,reason,evidence_pic,created_time,oid,tid,num,progress,status,sku,' . $tradeFields; try { $result = app::get('topshop')->rpcCall('aftersales.get', $params, 'seller'); } catch (Exception $e) { redirect::action('topshop_ctl_aftersales@index')->send(); exit; } $result['evidence_pic'] = $result['evidence_pic'] ? explode(',', $result['evidence_pic']) : null; $result['sendback_data'] = $result['sendback_data'] ? unserialize($result['sendback_data']) : null; $result['sendconfirm_data'] = $result['sendconfirm_data'] ? unserialize($result['sendconfirm_data']) : null; if ($result['user_id']) { $userName = app::get('topshop')->rpcCall('user.get.account.name', ['user_id' => $result['user_id']], 'seller'); $pagedata['userName'] = $userName[$result['user_id']]; } if ($result['sendback_data']['corp_code'] && $result['sendback_data']['corp_code'] != "other") { $logiData = explode('-', $result['sendback_data']['corp_code']); $result['sendback_data']['corp_code'] = $logiData[0]; $result['sendback_data']['logi_name'] = $logiData[1]; if ($result['sendback_data']['logi_no'] && $result['sendback_data']['corp_code']) { try { $tracker = app::get('topshop')->rpcCall('logistics.tracking.get.hqepay', array('logi_no' => $result['sendback_data']['logi_no'], 'corp_code' => $result['sendback_data']['corp_code'])); } catch (Exception $e) { } $pagedata['tracker'] = $tracker; } } if ($result['sendconfirm_data']['corp_code'] && $result['sendconfirm_data']['corp_code'] != "other") { $logiData = explode('-', $result['sendconfirm_data']['corp_code']); $result['sendconfirm_data']['corp_code'] = $logiData[0]; $result['sendconfirm_data']['logi_name'] = $logiData[1]; if ($result['sendconfirm_data']['logi_no'] && $result['sendconfirm_data']['corp_code']) { try { $tracker = app::get('topshop')->rpcCall('logistics.tracking.get.hqepay', array('logi_no' => $result['sendconfirm_data']['logi_no'], 'corp_code' => $result['sendconfirm_data']['corp_code'])); } catch (Exception $e) { } $pagedata['sendTracker'] = $tracker; } } //快递公司代码 $params['fields'] = "corp_code,corp_name"; $corpData = app::get('topshop')->rpcCall('logistics.dlycorp.get.list', $params); $pagedata['corpData'] = $corpData['data']; $pagedata['info'] = $result; return $this->page('topshop/aftersales/detail.html', $pagedata); }
public function handle($request, Clousure $next) { $routeAs = route::currentRouteName(); $currentPermission = shopAuth::getSellerPermission(); //$currentPermission = false 表示为店主不用判断权限 //获取当前用户的路由权限 if ($currentPermission && !in_array($routeAs, $currentPermission)) { if (request::ajax()) { return response::json(array('error' => true, 'message' => '无操作权限')); } else { return redirect::action('topshop_ctl_index@nopermission'); } } return $next($request); }
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'); }
/** * @brief 删除店铺收藏 */ function ajaxFavshopDel() { $userId = userAuth::id(); if (!$userId) { return redirect::action('topm_ctl_passport@signin'); } $params['shop_id'] = $_POST['shop_id']; $params['user_id'] = $userId; if (!$params['shop_id']) { return $this->splash('error', null, app::get('topm')->_('店铺id不能为空!')); } if (!app::get('topm')->rpcCall('user.shopcollect.del', $params)) { return $this->splash('error', null, app::get('topm')->_('店铺收藏删除失败!')); } else { return $this->splash('success', null, app::get('topm')->_('店铺收藏删除成功')); } }
/** * callback返回页, 同时是bind页面 * * @return base_http_response */ public function callback() { $params = input::get(); $flag = $params['flag']; unset($params['flag']); // 信任登陆校验 $userTrust = kernel::single('pam_trust_user'); $res = $userTrust->authorize($flag, 'web', 'topc_ctl_trustlogin@callBack', $params); $binded = $res['binded']; if ($binded) { $userId = $res['user_id']; userAuth::login($userId); return redirect::action('topc_ctl_default@index'); } else { $pagedata = compact('flag'); return $this->page('topc/bind.html', $pagedata); } }
public function index() { $tids = input::get('tid'); //面包屑 $this->runtimePath = array(['url' => url::action('topshop_ctl_index@index'), 'title' => app::get('topshop')->_('首页')], ['url' => url::action('topshop_ctl_trade_list@index'), 'title' => app::get('topshop')->_('订单列表')], ['title' => app::get('topshop')->_('订单详情')]); $params['tid'] = $tids; $params['fields'] = "user_id,tid,status,payment,ziti_addr,post_fee,pay_type,payed_fee,receiver_state,receiver_city,receiver_district,receiver_address,trade_memo,shop_memo,receiver_name,receiver_mobile,orders.price,orders.num,orders.title,orders.item_id,orders.pic_path,total_fee,discount_fee,buyer_rate,adjust_fee,orders.total_fee,orders.adjust_fee,created_time,shop_id,need_invoice,invoice_name,invoice_type,invoice_main"; $tradeInfo = app::get('topshop')->rpcCall('trade.get', $params, 'seller'); if (!$tradeInfo) { redirect::action('topshop_ctl_trade_list@index')->send(); exit; } $userInfo = app::get('topshop')->rpcCall('user.get.account.name', ['user_id' => $tradeInfo['user_id']], 'seller'); $tradeInfo['login_account'] = $userInfo[$tradeInfo['user_id']]; $pagedata['trade'] = $tradeInfo; $this->contentHeaderTitle = app::get('topshop')->_('订单详情'); return $this->page('topshop/trade/detail.html', $pagedata); }
public function createRate() { $tid = input::get('tid'); $tradeFiltr = array('tid' => $tid, 'fields' => 'tid,user_id,buyer_rate,shop_id,status,created_time,end_time,orders.oid,anony,orders.user_id,orders.price,orders.item_id,orders.sku_id,orders.title,orders.pic_path,orders.num'); $tradeInfo = app::get('topm')->rpcCall('trade.get', $tradeFiltr); if ($tradeInfo['buyer_rate'] == '0') { $tradeInfo['is_buyer_rate'] = true; } else { redirect::action('topm_ctl_member@index')->send(); exit; } if ($tradeInfo['user_id'] != userAuth::id()) { redirect::action('topm_ctl_member@index')->send(); exit; } $pagedata['tradeInfo'] = $tradeInfo; $this->action_view = "topm/member/rate/add.html"; return $this->page($this->action_view, $pagedata); }
public function index() { $keyword = input::get('keyword'); $searchType = input::get('searchtype'); if (!empty($keyword)) { try { if ($searchType == "shop") { return redirect::action('topc_ctl_gallery@index', array('searchContent' => $keyword)); } else { return redirect::action('topc_ctl_list@index', array('n' => $keyword)); } } catch (Exception $e) { $msg = $e->getMessage(); return $this->splash('error', null, $msg); } } else { return redirect::back(); } }
public function __construct($app) { pamAccount::setAuthType('sysshop'); $this->app = $app; $this->sellerId = pamAccount::getAccountId(); $this->sellerName = pamAccount::getLoginName(); $this->shopId = app::get('topshop')->rpcCall('shop.get.loginId', array('seller_id' => $this->sellerId), 'seller'); $action = route::current()->getActionName(); $actionArr = explode('@', $action); if ($actionArr['0'] != 'topshop_ctl_passport') { if (!$this->sellerId) { redirect::action('topshop_ctl_passport@signin')->send(); exit; } if (!$this->shopId && $actionArr[0] != 'topshop_ctl_enterapply') { redirect::action('topshop_ctl_enterapply@apply')->send(); exit; } } }
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() { $confg = shopWidgets::config(); $pagedata['config'] = $confg['pc']; if (input::get('show', false)) { $pagedata['showdialog'] = input::get('show'); $params = explode('-', input::get('show')); try { $dialogData = shopWidgets::getDialogData($params[0], $params[1], $this->shopId); $pagedata['data'] = $dialogData['data']; $pagedata['widgets_id'] = $dialogData['widgets_id']; $html = "topshop/shop/decorate/widgets/{$params[0]}/{$params[1]}.html"; } catch (Exception $e) { return redirect::action('topshop_ctl_shop_decorate@index'); } $pagedata['show_widgetsName'] = $params[0]; $pagedata['show_dialogName'] = $params[1]; $pagedata['html_file'] = $html; } $this->contentHeaderTitle = app::get('topshop')->_('店铺装修'); return $this->page('topshop/shop/decorate.html', $pagedata); }
public function store(CreateQuestionRequest $request) { $question = new \App\Question(); foreach (array_keys($this->fields) as $field) { $responce = $request->get($field); if ($responce == null && $this->fields[$field] !== '') { $responce = $this->fields[$field]; } $question->{$field} = $responce; } $question->save(); $formAnswers = $request->get('answers'); $recivedAnswers = array(); $validAnswer = $formAnswers[$request->isValid]; //return $validAnswer; for ($index = 0; $index < count($formAnswers); $index++) { $recivedAnswers[] = new \App\Answer(array('title' => $formAnswers[$index], 'question_id' => $question->id)); } $question->answers()->saveMany($recivedAnswers); $correctAnswerId = \App\Answer::select('id')->where('title', '=', $validAnswer)->where('question_id', '=', $question->id)->get(); $question->correct_answer_id = $correctAnswerId[0]->id; $question->save(); return redirect::action('Admin\\QuestionController@index')->withSuccess("The question '{$question->title}' was created."); }
/** * @brief 解绑第二步 * * @return html */ public function unVerifyTwo() { //会员信息 $userInfo = userAuth::getUserInfo(); $postdata = input::get(); if ($postdata['op'] == "delete" && !$userInfo['login_account'] && $postdata['verifyType'] == 'mobile') { return redirect::action('topc_ctl_member@pwdSet'); } $pagedata['userInfo'] = $userInfo; $pagedata['op'] = $postdata['op']; $pagedata['verifyType'] = $postdata['verifyType']; if ($postdata['verifyType'] == 'email' && $userInfo['email_verify']) { $this->action_view = "unemail.html"; } elseif ($postdata['verifyType'] == 'mobile' && $userInfo['mobile']) { $this->action_view = "unmobile.html"; } else { $msg = app::get('topc')->_('参数错误'); return $this->splash('error', $url, $msg); } return $this->output($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); }
public function edit() { $params['rate_id'] = input::get('rate_id', false); $params['role'] = 'buyer'; $params['fields'] = '*'; $data = app::get('topc')->rpcCall('rate.get', $params, 'buyer'); if (empty($data) || $data['is_lock']) { redirect::action('topc_ctl_member_rate@index')->send(); exit; } if ($data['rate_pic']) { $data['rate_pic'] = explode(',', $data['rate_pic']); } $pagedata['rateInfo'] = $data; $this->action_view = "rate/edit.html"; return $this->output($pagedata); }
public function logout() { userAuth::logout(); return redirect::action('topm_ctl_passport@signin'); }
public function postDetachProduct() { $first_product_id = Input::get('first_product_id'); $second_product_id = Input::get('second_product_id'); $slug_lang = Input::get('slug_lang'); try { $this->v_pp->validate(Input::all()); $this->r->detachProduct($first_product_id, $second_product_id); } catch (NotFoundException $e) { return Redirect::action("Palmabit\\Catalog\\Controllers\\ProductsController@getEdit", ["slug_lang" => $slug_lang])->withErrors(new MessageBag(["model" => "Prodotto non trovato."])); } catch (ValidationException $e) { return Redirect::action("Palmabit\\Catalog\\Controllers\\ProductsController@getEdit", ["slug_lang" => $slug_lang])->withErrors($this->v_pp->getErrors()); } return redirect::action("Palmabit\\Catalog\\Controllers\\ProductsController@getEdit", ["slug_lang" => $slug_lang])->with(array("message_accessories" => "Prodotto rimosso con successo.")); }
public function logout() { pamAccount::logout(); return redirect::action('topshop_ctl_passport@signin'); }
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); }