function Ajax() { $fid = get('fid', 'txt'); $wd = get('wd', 'txt'); $result = logic('isearcher')->Search($fid, $wd); exit(jsonEncode($result)); }
public function del_image() { $this->CheckAdminPrivs('seller'); $seller_id = get('seller_id', 'int'); $id = get('id', 'int'); if($seller_id > 0 && $id > 0) { $s = logic('seller')->GetOne($seller_id); if($s) { if ($s['imgs'] == '') { logic('upload')->Delete($id); } else { $imgs = explode(',', $s['imgs']); foreach ($imgs as $i => $iid) { if ($iid == $id) { logic('upload')->Delete($id); unset($imgs[$i]); } } $new = implode(',', $imgs); dbc(DBCMax)->update('seller')->data(array('imgs'=>$new))->where(array('id'=>$seller_id))->done(); } } } exit('ok'); }
public function log($orderid) { $orderid = (is_numeric($orderid) ? $orderid : 0); if(empty($orderid)) { return 'payfrom.log.orderid.empty'; } $paylog = logic('pay')->GetLog($orderid, 0, " `status` IN ('TRADE_FINISHED') ", true); if(false == $paylog) { return 'payfrom.log.paylog.empty'; } if(false == in_array($paylog['status'], array('TRADE_FINISHED'))) { return 'payfrom.log.paylog_status.error'; } $order = logic('order')->GetOne($orderid); if(fasle == $order) { return 'payfrom.log.orderid.error'; } $money = $paylog['money']; $uid = $order['userid']; $pid = $order['paytype']; $payment = logic('pay')->GetOne($pid); $pcode = $payment['code']; $pname = $payment['name']; if(false == in_array($pcode, array('alipay', 'alipaymobile'))) { return 'payfrom.log.payment_code.error'; } $payid = ($_POST['buyer_id'] ? $_POST['buyer_id'] : $_GET['buyer_id']); $payfrom = ($_POST['buyer_email'] ? $_POST['buyer_email'] : $_GET['buyer_email']); if(empty($payid) || empty($payfrom)) { return 'payfrom.log.payid.empty'; } if($payfrom != $paylog['payfrom']) { dbc(DBCMax)->update('paylog')->data(array('payfrom'=>$payfrom))->where(array('id'=>$paylog['id']))->done(); } $where = array( 'uid' => $uid, 'pid' => $pid, 'payid' => $payid, ); $info = dbc(DBCMax)->select('payfrom')->where($where)->limit(1)->done(); $data = array_merge($where, array( 'pcode' => $pcode, 'pname' => $pname, 'payfrom' => $payfrom, 'paynum' => max(0, (int) $info['paynum']) + 1, 'paysum' => max(0, (float) $info['paysum']) + $money, 'pay' => serialize(array_merge($where, array('paylog_id' => $paylog['id'], 'paylog_money' => $money, 'paylog_trade_no' => $paylog['trade_no'], 'paylog_status' => $paylog['status'], ))), 'time' => time(), )); if(false == $info) { $payfromid = dbc(DBCMax)->insert('payfrom')->data($data)->done(); } else { $payfromid = $info['id']; if($data['pay'] != $info['pay']) { dbc(DBCMax)->update('payfrom')->data($data)->where(array('id' => $payfromid))->done(); } } return $payfromid; }
public function view() { $id = get('id', 'int'); $article = logic('article')->get_one($id); $this->Title = $article['title']; include handler('template')->file('article_view'); }
public function GetList($where = '1') { $sql = dbc(DBCMax)->select('fund_order')->where($where)->order('createtime.desc')->sql(); logic('isearcher')->Linker($sql); $sql = page_moyo($sql); return dbc(DBCMax)->query($sql)->done(); }
public function save($product_id, $tag_ids) { $count = 0; $product_id = (int) $product_id; if($product_id > 0) { $tag_ids = (array) $tag_ids; foreach($tag_ids as $tag_id) { $tag_id = (int) $tag_id; if($tag_id > 0 && false != ($tr = logic('tag')->get_one($tag_id)) && false == self::get_one($product_id, $tag_id)) { if($tr['enable']) { $count = $count + 1; } if($count > 6) { $tr['enable'] = 0; } dbc(DBCMax)->insert('product_tag')->data(array( 'product_id' => $product_id, 'tag_id' => $tag_id, 'order' => $tr['order'], 'enable' => $tr['enable'], 'expire' => $tr['expire'], 'expire_time' => $tr['expire_time'], ))->done(); } } } }
function Main() { $pid = get('pid'); $pid || $pid = post('pid'); $pid || exit($this->Ends()); preg_match('/^[a-z0-9]+$/i', $pid) || exit($this->Ends()); $payment = logic('pay')->GetOne($pid); $payment || exit($this->Ends()); $status = logic('pay')->Verify($payment); $status || exit($this->Ends()); $trade = logic('pay')->TradeData($payment); $trade || exit($this->Ends()); if ($payment['code'] == 'alipay' || $payment['code'] == 'tenpay') { if (ini('payment.lp.enabled')) { if (MEMBER_ID) { header('Location: '.rewrite('index.php?mod=buy&code=order&op=process&sign='.$trade['sign'])); exit; } } } $parserAPI = logic('callback')->Parser($trade); $parserAPI->MasterIframe($this); preg_match('/^[a-z_]+$/i', $status) || exit($this->Ends()); $code = 'Parse_'.$status; method_exists($parserAPI, $code) || exit($this->Ends()); $parserAPI->$code($payment); }
function load( $area = '' ) { if ($area == '') { $area = str_replace('.', '_', mocod()); } $pox = 'widget.'.$area.'.blocks'; $list = ini($pox); if ( false === $list ) { if (substr($area, 0, 5) == 'html_') { $html = logic('html')->query(substr($area, 5)); ini('widget.'.$area, array('name' => $html['title'], 'blocks' => array())); } else { ini('widget.~@config.listener.enabled') && ini($pox, array()); } return; } echo '<!'.'-- widget @ [ '.$area.' ] --'.'>'; foreach ( $list as $name => $one ) { if (isset($one['enabled']) && $one['enabled']) { handler('template')->load('@widget/' . $name); } } }
function delete() { $product_id = get('product_id', 'int'); $tag_id = get('tag_id', 'int'); logic('product_tag')->delete($product_id, $tag_id); }
function del() { $this->CheckAdminPrivs('htmlset'); $flag = get('flag'); logic('html')->delete($flag); $this->Messager('页面已经删除!', '?mod=html&code=front'); }
public function send_sms() { $uid = get('uid', 'int'); $content = get('content', 'txt'); if (trim($content) == '') $this->ajax_response('err', '请输入短信内容!'); logic('push')->addi('sms', user($uid)->get('phone'), array('content'=>$content)); $this->ajax_response('ok', '短信发送完成!'); }
public function left() { // 菜单显示自定义方式 $mid = I('get.mid', 1); $menulist = logic('Menu')->getAccessibleLeftMenu($mid); $this->assign('menulist', $menulist); $this->display(); }
private function SendMsg($qq, $msg) { $result = $this->api->command('buddy.send', array( 'uid' => $qq, 'message' => $msg )); logic('push')->log('qqrobot', 'xiaoc', $qq, array('content'=>$msg), $result); return $result; }
function Upload_single() { $this->CheckAdminPrivs('delivery','ajax'); if(strlen(get('no','txt')) > 8){ logic('delivery')->Invoice(get('oid', 'number'), get('no', 'txt')) && exit('ok'); }else{ exit('error'); } }
function Ajax_Vfcode() { $phone = get('phone', 'number'); if (strlen($phone) != 11) exit('无效的手机号码!'); $vcode = get('vcode', 'number'); if (strlen($vcode) != 5) exit('无效的验证码!'); $r = logic('prize')->Vfcode($phone, $vcode); exit($r === true ? 'ok' : $r); }
/** * 购物车列表 */ public function cart_listOp() { $model_cart = Model('cart'); $logic_buy_1 = logic('buy_1'); $del_ids = $_POST['del_ids']; //购物车列表 $cart_list = $model_cart->listCart('db', array('buyer_id' => $this->member_info['member_id'])); // 购物车列表 [得到最新商品属性及促销信息] $cart_list = $logic_buy_1->getGoodsCartList($cart_list, $jjgObj, true); //购物车商品以店铺ID分组显示,并计算商品小计,店铺小计与总价由JS计算得出 $store_cart_list = array(); $total_price = 0; $total_save = 0; foreach ($cart_list as $cart) { $cart['goods_image_url'] = cthumb($cart['goods_image'], $cart['store_id']); $cart['goods_total'] = $cart['goods_price'] * $cart['goods_num']; if (in_array($cart['cart_id'], $del_ids)) { $cart['is_selected'] = 0; } else { $cart['is_selected'] = 1; $total_price += $cart['goods_total']; $total_save += ($cart['goods_marketprice'] - $cart['goods_price']) * $cart['goods_num']; $store_cart_list[$cart['store_id']]['cart_count'] += $cart['goods_num']; $store_cart_list[$cart['store_id']]['cart_price'] += $cart['goods_total']; } $store_cart_list[$cart['store_id']]['store_id'] = $cart['store_id']; $store_cart_list[$cart['store_id']]['store_name'] = $cart['store_name']; $store_cart_list[$cart['store_id']]['cart_list'][] = $cart; } // 店铺优惠券 // $condition = array(); // $condition['voucher_t_gettype'] = 3; // $condition['voucher_t_state'] = 1; // $condition['voucher_t_end_date'] = array('gt', time()); // $condition['voucher_t_mgradelimit'] = array('elt', $this->member_info['level']); // $condition['voucher_t_store_id'] = array('in', array_keys($store_cart_list)); // $voucher_template = Model('voucher')->getVoucherTemplateList($condition); // $voucher_template = array_under_reset($voucher_template, 'voucher_t_store_id', 2); // Tpl::output('voucher_template', $voucher_template); //取得店铺级活动 - 可用的满即送活动 $mansong_rule_list = $logic_buy_1->getMansongRuleList(array_keys($store_cart_list)); //取得哪些店铺有满免运费活动 $free_freight_list = $logic_buy_1->getFreeFreightActiveList(array_keys($store_cart_list)); $is_selected = 1; foreach ($store_cart_list as $k => $v) { $store_cart_list[$k]['mansong'] = $mansong_rule_list[$k]['desc']; $store_cart_list[$k]['free_freight'] = $free_freight_list[$k]; $store_cart_list[$k]['is_selected'] = 1; foreach ($v['cart_list'] as $kk => $vv) { if ($vv['is_selected'] == 0) { $store_cart_list[$k]['is_selected'] = 0; $is_selected = 0; } } } output_data(array('store_cart_list' => $store_cart_list, 'total_price' => $total_price, 'total_save' => $total_save, 'is_selected' => $is_selected)); }
public function delete() { $post_type = I('get.post_type', ''); $taxonomy_name = I('get.taxonomy_name'); if (logic('taxonomy')->deleteTaxonomy($post_type, $taxonomy_name) !== false) { $this->success('操作成功!'); } else { $this->error(logic('taxonomy')->getErrorMessage()); } }
public function __construct() { $alipay = logic('pay')->SrcOne('alipay'); $cfg = unserialize($alipay['config']); $this->config = array( 'partner' => $cfg['partner'], 'key' => $cfg['key'], 'ssl' => $cfg['ssl'] ); }
public function ajax_view() { $this->CheckAdminPrivs('comments','ajax'); $id = get('id', 'int'); $comment = logic('comment')->source_get_one($id); if($comment['img']){ $comment['content'] .= "<br><img src='".imager($comment['img'], IMG_Normal)."'>"; } exit($comment['content']); }
public function found($type, $detail = null) { if (!logic('misc')->siteInstalled()) { return 'SITE_NOT_INSTALLED'; } if ($type == 'mysql') { $this->mysqlErrorCNT ++ ; if ($this->mysqlErrorCNT >= $this->mysqlErrorMax) { $this->mysqlErrorCNT = 0; return 'TOO_MANY_ERROR'; } } $nameMAP = array( 'mysql' => '数据库执行错误', 'error.msockopen' => 'msockopen函数报错', 'file.missing' => '系统缺失某些文件,执行中断', 'missing.gzopen' => '服务器不支持gzopen函数,文件解压失败', 'denied.io' => '文件读写失败,请检查权限', 'missing.object' => '系统无法解析对象,执行中断', 'queue' => '任务队列执行出错' ); if ($detail == null) { $lastError = function_exists('error_get_last') ? error_get_last() : array(); if ($lastError['message']) { $detail = $lastError['message']; } else { $detail = ''; } } $wName = isset($nameMAP[$type]) ? $nameMAP[$type] : ('未知错误类型:'.$type); $btString = ''; $btAll = function_exists('debug_backtrace') ? debug_backtrace() : false; if ($btAll) { $btLength = count($btAll); $btLength > 7 && $btLength = 7; $btIII = 0; for ($btI = $btLength; $btI > 0; $btI--) { $btOne = $btAll[$btI-1]; $btIII ++; $btString .= $btIII.'. FILE:'.basename($btOne['file']).' - LINE:'.$btOne['line'].' - FUNC:'.$btOne['function'].'<br/>'; } $btString = '<div class="btString">'.$btString.'</div>'; } $this->zlogCreate($type, $wName, $detail.$btString); }
public function Invoice($oid, $invoice) { $order = logic('order')->GetOne($oid); $ups = array(); $order['invoice'] = $invoice; $ups['invoice'] = $invoice; $order['expresstime'] || $ups['expresstime'] = time(); logic('order')->Update($oid, $ups); $order['process'] == 'WAIT_SELLER_SEND_GOODS' && logic('pay')->SendGoods($order, true); return true; }
public function GoodSender($payment, $express, $sign, $type) { if ($type == 'ticket') { logic('callback')->Bridge($sign)->Processed($sign, 'TRADE_FINISHED'); } else { logic('callback')->Bridge($sign)->Processed($sign, 'WAIT_BUYER_CONFIRM_GOODS'); } }
public function checkLogin() { $login_logic = logic('login'); $result = $login_logic->checkLogin(I('account'), I('password'), I('verify')); if ($result === false) { $this->assign('jumpUrl', $login_logic->getJumpUrl()); $this->error($login_logic->getErrorMessage()); } else { $this->success('登录成功!', __MODULE__ . '/Index'); } }
public function del() { $id = I('get.id'); if (empty($id)) { $this->error('异常操作!', __MODULE__ . '/User/index'); } if (logic('user')->delete($id) !== fasle) { $this->success('操作成功!', __MODULE__ . '/User/index'); } else { $this->error('操作失败!', __MODULE__ . '/User/index'); } }
public function vfsend() { $phone = post('phone', 'txt'); $ret = logic('phone')->Check($phone); if(false == $ret) { $ret = logic('phone')->VfSend($phone); } exit($ret); }
/** * @copyright (C)2014 Cenwor Inc. * @author Cenwor <www.cenwor.com> * @package php * @name howparallel.function.php * @date 2014-09-01 17:24:22 */ function ad_config_save_parser_howparallel(&$data) { if (count($data['list']) < 1) return; $orders = array(); logic('upload')->Save('file_adl', './uploads/images/howparallel/hl.gif'); logic('upload')->Save('file_adr', './uploads/images/howparallel/hr.gif'); $data['list']['adl']['image'] = 'uploads/images/howparallel/hl.gif'; $data['list']['adr']['image'] = 'uploads/images/howparallel/hr.gif'; $data['fu'] = true; }
public function delete() { $modelid = intval($_GET['modelid']); $model = $this->db->find($modelid); if (empty($model)) { $this->error('模型不存在!'); } if (logic('Model')->deleteModel($model)) { $this->success('删除成功'); } else { $this->error('删除失败'); } }
public function del() { $nid = intval($_GET['nid']); if (empty($nid)) { $this->error('异常操作!', __MODULE__ . '/Menu/index'); } $result = logic('Menu')->dropNodes($nid); if ($result) { $this->success('操作成功!', __MODULE__ . '/Menu/index'); } else { $this->error('操作失败!', __MODULE__ . '/Menu/index'); } }
public function order_confirm() { $this->CheckAdminPrivs('cashorder'); $orderid = get('orderid', 'number'); if ($orderid) { $r = logic('cash')->MakeSuccessed($orderid); exit('ok'); } else { exit('提现记录流水号不正确'); } }
public function order_confirm() { $this->CheckAdminPrivs('rechargeorder','ajax'); $orderid = get('orderid', 'number'); if ($orderid) { $r = logic('recharge')->MakeSuccessed($orderid); exit('ok'); } else { exit('充值记录流水号不正确'); } }