本文整理汇总了PHP中output_error函数的典型用法代码示例。如果您正苦于以下问题:PHP output_error函数的具体用法?PHP output_error怎么用?PHP output_error使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了output_error函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_info
function get_info($request_id = NULL, $unsubscribe_key = NULL)
{
if (is_null($result = $this->lib_archive->get_info($request_id, $unsubscribe_key))) {
output_error($this->lib_archive->get_error_message());
}
output($result);
}
示例2: serviceOp
/**
* GET 服务详情
*/
public function serviceOp()
{
if (!isset($_GET['sid'])) {
output_error("缺少服务id参数");
die;
}
$service_id = $_GET['sid'];
$m_service = Model('serviceapi');
$where = array('service_id' => $service_id);
$service_info = $m_service->where($where)->order('service_id desc')->select();
// TODO 服务收藏
// if (intval($_GET['fav_id']) > 0) {
// $favorites_class = Model('flea_favorites');
// if (!$favorites_class->checkFavorites(intval($_GET['fav_id']), 'flea', intval($_GET['user_id']))) {
// $service_info[0][is_favorite] = false;
// }
// }
$goods_image_path = UPLOAD_SITE_URL . DS . ATTACH_SERVICE . '/';
//店铺商品图片目录地址
$desc_image = $m_service->getListImageService(array('item_id' => $service_id, 'upload_type' => 8));
$m_service->getThumb($desc_image, $goods_image_path);
$service_info[0]['service_image'] = $desc_image;
/**
* 浏览次数更新
*/
$m_service->updateService(array('service_click' => $service_info[0]['service_click'] + 1), $service_id);
if (!empty($service_info)) {
output_data(array('service_info' => $service_info));
} else {
output_error("没有此交易");
}
}
示例3: comments_listOp
/**
* 商品评价详细页
*/
public function comments_listOp()
{
$goods_id = intval($_GET['goods_id']);
// 商品详细信息
$model_goods = Model('goods');
$goods_info = $model_goods->getGoodsInfoByID($goods_id, '*');
// 验证商品是否存在
if (empty($goods_info)) {
output_error('商品不存在');
}
//评价信息
$goods_evaluate_info = Model('evaluate_goods')->getEvaluateGoodsInfoByGoodsID($goods_id);
$buy_comments['goods_evaluate_info']['good'] = $goods_evaluate_info['good'];
$buy_comments['goods_evaluate_info']['normal'] = $goods_evaluate_info['normal'];
$buy_comments['goods_evaluate_info']['bad'] = $goods_evaluate_info['bad'];
$buy_comments['goods_evaluate_info']['all'] = $goods_evaluate_info['all'];
$buy_comments['goods_evaluate_info']['good_percent'] = $goods_evaluate_info['good_percent'];
$buy_comments['goods_evaluate_info']['normal_percent'] = $goods_evaluate_info['normal_percent'];
$buy_comments['goods_evaluate_info']['bad_percent'] = $goods_evaluate_info['bad_percent'];
$buy_comments['goods_evaluate_info']['good_star'] = $goods_evaluate_info['good_star'];
$buy_comments['goods_evaluate_info']['star_average'] = $goods_evaluate_info['star_average'];
$buy_comments['comments'] = $this->_get_comments($goods_id, $_GET['type'], 5);
$buy_comments['goods_evaluate_info']['page'] = $this->_getcomments($goods_id, $_GET['type'], 5);
if (empty($buy_comments['comments'])) {
output_error('暂时没有评论');
}
if ($buy_comments['goods_evaluate_info']['page']['page'] > $buy_comments['goods_evaluate_info']['page']['show_pa']) {
$buy_comments['comments'] = null;
}
output_data($buy_comments);
}
示例4: transactional
public function transactional($message_id = 0)
{
if (is_null($result = $this->lib_message->add_request($message_id))) {
output_error($this->lib_message->get_error_message());
}
output($result);
}
示例5: indexOp
/**
* 登录
*/
public function indexOp()
{
if (empty($_POST['seller_name']) || empty($_POST['password']) || !in_array($_POST['client'], $this->client_type_array)) {
output_error('用户名密码不能为空');
}
$model_seller = Model('seller');
$seller_info = $model_seller->getSellerInfo(array('seller_name' => $_POST['seller_name']));
if (!$seller_info) {
output_error('登录失败');
}
//店铺所有人或者授权的子账号可以从客户端登录
if (!($seller_info['is_admin'] || $seller_info['is_client'])) {
output_error('权限验证失败');
}
//验证身份
$model_member = Model('member');
$member_info = $model_member->getMemberInfo(array('member_id' => $seller_info['member_id'], 'member_passwd' => strtolower($_POST['password'])));
if (!$member_info) {
output_error('用户名密码错误');
}
//读取店铺信息
$model_store = Model('store');
$store_info = $model_store->getStoreInfoByID($seller_info['store_id']);
//更新卖家登陆时间
$model_seller->editSeller(array('last_login_time' => TIMESTAMP), array('seller_id' => $seller_info['seller_id']));
//生成登录令牌
$token = $this->_get_token($seller_info['seller_id'], $seller_info['seller_name'], $_POST['client']);
if ($token) {
output_data(array('seller_name' => $seller_info['seller_name'], 'store_name' => $store_info['store_name'], 'key' => $token));
} else {
output_error('登录失败');
}
}
示例6: indate_code_listOp
public function indate_code_listOp()
{
$order_id = intval($_POST['order_id']);
if ($order_id <= 0) {
output_error('订单不存在');
}
$model_vr_order = Model('vr_order');
$condition = array();
$condition['order_id'] = $order_id;
$condition['buyer_id'] = $this->member_info['member_id'];
$order_info = $model_vr_order->getOrderInfo($condition);
if (empty($order_info) || $order_info['delete_state'] == ORDER_DEL_STATE_DROP) {
output_error('订单不存在');
}
$order_list = array();
$order_list[$order_id] = $order_info;
$order_list = $model_vr_order->getCodeRefundList($order_list);
//没有使用的兑换码列表
$code_list = array();
if (!empty($order_list[$order_id]['code_list'])) {
foreach ($order_list[$order_id]['code_list'] as $value) {
$code = array();
$code['vr_code'] = $value['vr_code'];
$code['vr_indate'] = $value['vr_indate'];
$code_list[] = $code;
}
}
output_data(array('code_list' => $code_list));
}
示例7: addRule
public function addRule()
{
$express_id = $this->input->get_post('express_id');
$province_code = $this->input->get_post('province_code');
$rule = $this->express_rule_model->getOneByProvince($express_id, $province_code);
if (!$rule) {
$rule_add = array('express_id' => $express_id, 'province_code' => $province_code);
$rule['rule_id'] = $this->express_rule_model->add($rule_add);
}
//先检查是否存在该区间
$weight_min = $this->input->get_post('weight_min');
$weight_max = $this->input->get_post('weight_max');
$item1 = $this->express_rule_model->getItemByRuleAndWeight($rule['rule_id'], $weight_min);
$item2 = $this->express_rule_model->getItemByRuleAndWeight($rule['rule_id'], $weight_max);
$item3 = $this->express_rule_model->getItemByRuleAndWeightBetween($rule['rule_id'], $weight_min, $weight_max);
if ($item1) {
output_error('其他区间已经包含起始重量');
}
if ($item2) {
output_error('其他区间已经包含结束重量');
}
if ($item3) {
output_error('重量区间重复');
}
$item = array('rule_id' => $rule['rule_id'], 'express_id' => $express_id, 'price_type' => $this->input->get_post('price_type'), 'price' => $this->input->get_post('price'), 'weight_min' => $weight_min, 'weight_max' => $weight_max, 'sort_order' => $this->input->get_post('sort_order'));
$this->express_rule_item_model->add($item);
$this->show();
}
示例8: store_editOp
/**
* 编辑店铺
*/
public function store_editOp()
{
$upload = new UploadFile();
/**
* 上传店铺图片
*/
if (!empty($_FILES['store_banner']['name'])) {
$upload->set('default_dir', ATTACH_STORE);
$upload->set('thumb_ext', '');
$upload->set('file_name', '');
$upload->set('ifremove', false);
$result = $upload->upfile('store_banner');
if ($result) {
$_POST['store_banner'] = $upload->file_name;
} else {
showDialog($upload->error);
}
}
//删除旧店铺图片
if (!empty($_POST['store_banner']) && !empty($store_info['store_banner'])) {
@unlink(BASE_UPLOAD_PATH . DS . ATTACH_STORE . DS . $this->store_info['store_banner']);
}
/**
* 更新入库
*/
$param = array('store_banner' => empty($_POST['store_banner']) ? $this->store_info['store_banner'] : $_POST['store_banner'], 'store_qq' => $_POST['store_qq'], 'store_ww' => $_POST['store_ww'], 'store_phone' => $_POST['store_phone'], 'store_zy' => $_POST['store_zy'], 'store_keywords' => $_POST['seo_keywords'], 'store_description' => $_POST['seo_description']);
$result = Model('store')->editStore($param, array('store_id' => $this->store_info['store_id']));
if (!$result) {
output_error('编辑失败');
}
output_data('1');
}
示例9: addRule
public function addRule()
{
$customer_id = 0;
$customer_rent_id = $this->input->get_post('customer_rent_id');
$province_code = $this->input->get_post('province_code');
$rule = $this->customer_express_rule_model->getOneByRent($customer_rent_id, $province_code);
$customer_id = $rule['customer_id'];
if (!$rule) {
$rent = $this->customer_rent_model->getCustomerRent($customer_rent_id);
$customer_id = $rent['customer_id'];
$rule_add = array('customer_id' => $customer_id, 'customer_rent_id' => $customer_rent_id, 'province_code' => $province_code);
$rule['rule_id'] = $this->customer_express_rule_model->add($rule_add);
}
$weight_min = $this->input->get_post('weight_min');
$weight_max = $this->input->get_post('weight_max');
//先检查是否存在该区间
$item1 = $this->customer_express_rule_model->getItemByRuleAndWeight($rule['rule_id'], $weight_min);
$item2 = $this->customer_express_rule_model->getItemByRuleAndWeight($rule['rule_id'], $weight_max);
$item3 = $this->customer_express_rule_model->getItemByRuleAndWeightBetween($rule['rule_id'], $weight_min, $weight_max);
if ($item1) {
output_error('其他区间已经包含起始重量');
}
if ($item2) {
output_error('其他区间已经包含结束重量');
}
if ($item3) {
output_error('重量区间重复');
}
$item = array('rule_id' => $rule['rule_id'], 'customer_id' => $customer_id, 'customer_rent_id' => $customer_rent_id, 'weight_price_type' => $this->input->get_post('weight_price_type'), 'weight_min' => $weight_min, 'weight_max' => $weight_max, 'weight_start' => $this->input->get_post('weight_start'), 'weight_start_price' => $this->input->get_post('weight_start_price'), 'weight_pre' => $this->input->get_post('weight_pre'), 'weight_pre_price' => $this->input->get_post('weight_pre_price'), 'sort_order' => $this->input->get_post('sort_order'));
$this->customer_express_rule_item_model->add($item);
$this->show();
}
示例10: __construct
public function __construct()
{
parent::__construct();
if (C('voucher_allow') != 1) {
output_error('暂不支持代金券设置');
//showDialog(L('voucher_pointunavailable'),'index.php','error');
}
}
示例11: load_member
function load_member($pid)
{
$member = new MEMBER(array('person_id' => $pid));
if (!$member->valid) {
output_error('Unknown ID');
}
$member->load_extra_info();
return $member;
}
示例12: getMysqlConnection
private function getMysqlConnection($db)
{
if (!@is_string($db) || empty($db)) {
output_error(404, "404 Database Not Found");
} else {
$result = @mysqli_connect($this->hostname, $this->myql_username, $this->myql_password, $db) or output_error(503, "503 Database Unavailable");
return $result;
}
}
示例13: returnopenidOp
public function returnopenidOp()
{
$payment_api = $this->_get_payment_api();
if ($this->payment_code != 'wxpay') {
output_error('支付参数异常');
die;
}
$payment_api->getopenid();
}
示例14: image_uploadOp
public function image_uploadOp()
{
$logic_goods = Logic('goods');
$result = $logic_goods->uploadGoodsImage($_POST['name'], $this->seller_info['store_id'], $this->store_grade['sg_album_limit']);
if (!$result['state']) {
output_error($result['msg']);
}
output_data(array('image_name' => $result['data']['name']));
}
示例15: recommend_voucherOp
public function recommend_voucherOp()
{
//开启代金券功能后查询推荐的热门代金券列表
if (C('voucher_allow') == 1) {
$recommend_voucher = Model('voucher')->getRecommendTemplate(6);
output_data(array('vouchers' => $recommend_voucher));
} else {
output_error("并没有开启代金券功能");
die;
}
}