public function favor() { $this->isLogin(); $op = ggp('op'); if ($op == 'do') { $goods_id = ggp('id:i'); if (D('Member')->addFavor($this->my['uid'], $goods_id)) { $this->success('收藏成功'); } else { $this->success('您已经收藏该商品'); } } $pre = getPre(); $goods = M()->field('g.*')->table("{$pre}favor f")->join("{$pre}goods g on f.goods_id=g.goods_id")->where("f.uid='{$this->my['uid']}'")->select(); $this->assign('goods', $goods); $this->display(); }
private function addField($table, $field, $param) { $table = getPre() . $table; if (!M()->query("select COLUMN_NAME from information_schema.COLUMNS where table_name='{$table}' and COLUMN_NAME='{$field}'")) { M()->execute("ALTER TABLE `{$table}` ADD `{$field}` {$param}"); } }
function translateCommonlabel($template) { global $pagesize, $articleid; $template = str_replace("【#sitename】", getSitename(), $template); $template = str_replace("【#htmltitle】", getHtmltitle(), $template); $template = str_replace("【#copyright】", getCopyright(), $template); $template = str_replace("【#path】", getPath(), $template); $template = str_replace("【#logo】", getLogo(), $template); $template = str_replace("【#chanels】", getChanels(), $template); $template = str_replace("【#childcolumnlist】", getChildcolumnlist(), $template); //网站,栏目,文章关键字 $template = str_replace("【#sitekeywords】", getSitekeywords(), $template); $template = str_replace("【#columnkeywords】", getColumnkeywords(), $template); $template = str_replace("【#articlekeywords】", getArticlekeywords(), $template); $template = str_replace("【#columnname】", getColumnname(), $template); $template = str_replace("【#articleid】", $articleid, $template); $template = str_replace("【#articletitle】", getArticletitle(), $template); $template = str_replace("【#articlecontent】", getArticlecontent(), $template); $template = str_replace("【#date】", getAdddate(), $template); $template = str_replace("【#hits】", getHits(), $template); $template = str_replace("【#author】", getAuthor(), $template); $template = str_replace("【#source】", getSource(), $template); $template = str_replace("【#picurl】", getPicurl(), $template); $template = str_replace("【#pre】", getPre(), $template); $template = str_replace("【#next】", getNext(), $template); $template = str_replace("【#notes】", getNotes(), $template); $template = str_replace("【#commentform】", getCommentform(), $template); //替换自定义字段标签 $template = translateSdefFeildlabel($template); $template = str_replace("【#showpage】", getPage($pagesize), $template); return $template; }
private function payType2($order) { require_once ROOT . "api/payment/alipay_double/alipay.config.php"; require_once ROOT . "api/payment/alipay_double/lib/alipay_submit.class.php"; $payment_type = '1'; $quantity = "1"; //必填,建议默认为1,不改变值,把一次交易看成是一次下订单而非购买一件商品 //物流费用 $logistics_fee = "0.00"; //必填,即运费 //物流类型 $logistics_type = "EXPRESS"; //必填,三个值可选:EXPRESS(快递)、POST(平邮)、EMS(EMS) //物流支付方式 $logistics_payment = "SELLER_PAY"; //$order['order_price'] = 0.01; $pre = getPre(); $service = array('2' => 'create_partner_trade_by_buyer', '3' => 'trade_create_by_buyer'); $parameter = array("service" => $service[$this->setting['alipay_on']], "partner" => trim($alipay_config['partner']), "payment_type" => $payment_type, "notify_url" => SITE_URL . 'web_notify.php', "return_url" => SITE_URL . 'web_callback.php', "seller_email" => $alipay_config['alipay_account'], "out_trade_no" => $order['order_sn'], "subject" => $order['order_id'], "price" => $order['order_price'], "quantity" => $quantity, "logistics_fee" => $logistics_fee, "logistics_type" => $logistics_type, "logistics_payment" => $logistics_payment, "body" => $body, "show_url" => $show_url, "receive_name" => $receive_name, "receive_address" => $receive_address, "receive_zip" => $receive_zip, "receive_phone" => $receive_phone, "receive_mobile" => $receive_mobile, "_input_charset" => trim(strtolower($alipay_config['input_charset']))); //建立请求 $alipaySubmit = new AlipaySubmit($alipay_config); $url = $alipaySubmit->buildRequestForm($parameter, "get", "确认"); @header("Location:{$url}"); exit; }