當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CommonAction::success方法代碼示例

本文整理匯總了PHP中CommonAction::success方法的典型用法代碼示例。如果您正苦於以下問題:PHP CommonAction::success方法的具體用法?PHP CommonAction::success怎麽用?PHP CommonAction::success使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CommonAction的用法示例。


在下文中一共展示了CommonAction::success方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: update

 public function update()
 {
     B('FilterString');
     $data = M(MODULE_NAME)->create();
     switch ($data['status']) {
         case 0:
             $action = 'wait';
             break;
         case 1:
             $action = 'success';
             break;
         case 2:
             $action = 'failed';
             break;
         case 3:
             $action = 'waitpay';
             break;
         case 4:
             $action = 'reback';
             break;
         default:
             $action = 'index';
             break;
     }
     // 更新數據
     $list = M(MODULE_NAME)->save($data);
     if ($list > 0) {
         $sdata['update_time'] = TIME_UTC;
         $sdata['id'] = $data['id'];
         M(MODULE_NAME)->save($sdata);
         //成功提示
         $vo = M(MODULE_NAME)->where("id=" . $data['id'])->find();
         $user_id = $vo['user_id'];
         $user_info = M("User")->where("id=" . $user_id)->find();
         require_once APP_ROOT_PATH . "/system/libs/user.php";
         if ($data['status'] == 1) {
             //提現
             modify_account(array("lock_money" => -$vo['money']), $vo['user_id'], "提現成功", 8);
             modify_account(array("lock_money" => -$vo['fee']), $vo['user_id'], "提現成功", 9);
             $content = "您於" . to_date($vo['create_time'], "Y年m月d日 H:i:s") . "提交的" . format_price($vo['money']) . "提現申請匯款成功,請查看您的資金記錄。";
             $group_arr = array(0, $user_id);
             sort($group_arr);
             $group_arr[] = 6;
             $msg_data['content'] = $content;
             $msg_data['to_user_id'] = $user_id;
             $msg_data['create_time'] = TIME_UTC;
             $msg_data['type'] = 0;
             $msg_data['group_key'] = implode("_", $group_arr);
             $msg_data['is_notice'] = 6;
             $GLOBALS['db']->autoExecute(DB_PREFIX . "msg_box", $msg_data);
             $id = $GLOBALS['db']->insert_id();
             $GLOBALS['db']->query("update " . DB_PREFIX . "msg_box set group_key = '" . $msg_data['group_key'] . "_" . $id . "' where id = " . $id);
             //短信通知
             if (app_conf("SMS_ON") == 1) {
                 $tmpl = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "msg_template where name = 'TPL_CARYY_SUCCESS_SMS'");
                 $tmpl_content = $tmpl['content'];
                 $notice['user_name'] = $user_info["user_name"];
                 $notice['carry_money'] = $vo['money'];
                 $notice['site_name'] = app_conf("SHOP_TITLE");
                 $GLOBALS['tmpl']->assign("notice", $notice);
                 $msg = $GLOBALS['tmpl']->fetch("str:" . $tmpl_content);
                 $msg_data['dest'] = $user_info['mobile'];
                 $msg_data['send_type'] = 0;
                 $msg_data['title'] = "提現成功短信提醒";
                 $msg_data['content'] = addslashes($msg);
                 $msg_data['send_time'] = 0;
                 $msg_data['is_send'] = 0;
                 $msg_data['create_time'] = TIME_UTC;
                 $msg_data['user_id'] = $user_info['id'];
                 $msg_data['is_html'] = $tmpl['is_html'];
                 $GLOBALS['db']->autoExecute(DB_PREFIX . "deal_msg_list", $msg_data);
                 //插入
             }
         } elseif ($data['status'] == 2) {
             //駁回
             modify_account(array("money" => $vo['money'], "lock_money" => -$vo['money']), $vo['user_id'], "提現失敗", 8);
             modify_account(array("money" => $vo['fee'], "lock_money" => -$vo['fee']), $vo['user_id'], "提現失敗", 9);
             $content = "您於" . to_date($vo['create_time'], "Y年m月d日 H:i:s") . "提交的" . format_price($vo['money']) . "提現申請被我們駁回,駁回原因\"" . $data['msg'] . "\"";
             $group_arr = array(0, $user_id);
             sort($group_arr);
             $group_arr[] = 7;
             $msg_data['content'] = $content;
             $msg_data['to_user_id'] = $user_id;
             $msg_data['create_time'] = TIME_UTC;
             $msg_data['type'] = 0;
             $msg_data['group_key'] = implode("_", $group_arr);
             $msg_data['is_notice'] = 7;
             $GLOBALS['db']->autoExecute(DB_PREFIX . "msg_box", $msg_data);
             $id = $GLOBALS['db']->insert_id();
             $GLOBALS['db']->query("update " . DB_PREFIX . "msg_box set group_key = '" . $msg_data['group_key'] . "_" . $id . "' where id = " . $id);
         }
         save_log("編號為" . $data['id'] . "的提現申請" . L("UPDATE_SUCCESS"), 1);
         //開始驗證有效性
         $this->assign("jumpUrl", u(MODULE_NAME . "/" . $action));
         parent::success(L("UPDATE_SUCCESS"));
     } else {
         //錯誤提示
         $DBerr = M()->getDbError();
         save_log("編號為" . $data['id'] . "的提現申請" . L("UPDATE_FAILED") . $DBerr, 0);
         $this->error(L("UPDATE_FAILED") . $DBerr, 0);
//.........這裏部分代碼省略.........
開發者ID:norain2050,項目名稱:fanwei_xindai_3.2,代碼行數:101,代碼來源:UserCarryAction.class.php

示例2: delete

 public function delete()
 {
     //徹底刪除指定記錄
     $ajax = intval($_REQUEST['ajax']);
     $id = $_REQUEST['id'];
     if (isset($id)) {
         $condition = array('id' => array('in', explode(',', $id)));
         $list = M(MODULE_NAME)->where($condition)->delete();
         if ($list !== false) {
             save_log(l("FOREVER_DELETE_SUCCESS"), 1);
             parent::success(l("FOREVER_DELETE_SUCCESS"), $ajax);
         } else {
             save_log(l("FOREVER_DELETE_FAILED"), 0);
             $this->error(l("FOREVER_DELETE_FAILED"), $ajax);
         }
     } else {
         $this->error(l("INVALID_OPERATION"), $ajax);
     }
 }
開發者ID:eliu03,項目名稱:fanweP2P,代碼行數:19,代碼來源:UserCarryAction.class.php

示例3: saveconfig

 public function saveconfig()
 {
     $config = $_POST['config'];
     $has_ids = null;
     foreach ($config['id'] as $k => $v) {
         if (intval($v) > 0) {
             $has_ids[] = $v;
         }
     }
     M()->query("DELETE FROM " . DB_PREFIX . "user_carry_config WHERE id not in (" . implode(",", $has_ids) . ")");
     foreach ($config['id'] as $k => $v) {
         if (intval($v) > 0) {
             $config_data = array();
             $config_data['id'] = $v;
             $config_data['name'] = trim($config['name'][$k]);
             $config_data['min_price'] = floatval($config['min_price'][$k]);
             $config_data['max_price'] = floatval($config['max_price'][$k]);
             $config_data['fee'] = floatval($config['fee'][$k]);
             $config_data['vip_id'] = intval($config['vip_id'][$k]);
             $config_data['fee_type'] = intval($config['fee_type'][$k]);
             M("UserCarryConfig")->save($config_data);
         }
     }
     $aconfig = $_POST['aconfig'];
     foreach ($aconfig['name'] as $k => $v) {
         if (trim($v) != "") {
             $config_data = array();
             $config_data['name'] = trim($v);
             $config_data['min_price'] = floatval($aconfig['min_price'][$k]);
             $config_data['max_price'] = floatval($aconfig['max_price'][$k]);
             $config_data['fee'] = floatval($aconfig['fee'][$k]);
             $config_data['vip_id'] = intval($aconfig['vip_id'][$k]);
             $config_data['fee_type'] = intval($aconfig['fee_type'][$k]);
             M("UserCarryConfig")->add($config_data);
         }
     }
     rm_auto_cache("user_carry_config");
     parent::success(L("UPDATE_SUCCESS"));
 }
開發者ID:eliu03,項目名稱:fanweP2P,代碼行數:39,代碼來源:VipSettingAction.class.php

示例4: intval

 function do_reback()
 {
     $id = intval($_REQUEST['id']);
     if ($id == 0) {
         $this->error("操作失敗", 0);
         die;
     }
     $id = intval($_REQUEST['id']);
     $deal_id = $GLOBALS['db']->getOne("SELECT deal_id FROM " . DB_PREFIX . "deal_load_transfer WHERE id=" . $id);
     if ($deal_id == 0) {
         $this->error("不存在的債權");
         die;
     }
     $condition = ' AND dlt.id=' . $id . ' AND d.deal_status >= 4 and d.is_effect=1 and d.is_delete=0 and d.repay_time_type =1 and  d.publish_wait=0 ';
     $union_sql = " LEFT JOIN " . DB_PREFIX . "deal_load_transfer dlt ON dlt.deal_id = dl.deal_id ";
     $transfer = get_transfer($union_sql, $condition);
     if ($transfer['t_user_id'] > 0) {
         $this->error("債權已轉讓,無法撤銷", 0);
         die;
     }
     $msg = strim($_POST['msg']);
     if ($msg == "") {
         $this->error("請輸入撤銷原因", 0);
         die;
     }
     $GLOBALS['db']->query("UPDATE  " . DB_PREFIX . "deal_load_transfer SET status=0 WHERE id=" . $id);
     if ($GLOBALS['db']->affected_rows() > 0) {
         $notice['shop_title'] = app_conf("SHOP_TITLE");
         $notice['url'] = "“<a href=\"" . url("index", "transfer#detail", array("id" => $v['id'])) . "\">Z-" . $v['load_id'] . "</a>”";
         $notice['msg'] = "因為:“" . $msg . "”被管理員撤銷了";
         $tmpl_content = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "msg_template where name = 'TPL_DEAL_SUCCESS_SITE_SMS'", false);
         $GLOBALS['tmpl']->assign("notice", $notice);
         $content = $GLOBALS['tmpl']->fetch("str:" . $tmpl_content['content']);
         send_user_msg("", $content, 0, $transfer['user_id'], TIME_UTC, 0, true, 17);
         save_log("撤銷編號:{$id的債券轉讓}", 1);
         parent::success("撤銷成功!");
         die;
     } else {
         save_log("撤銷編號:{$id的債券轉讓}", 0);
         $this->error("撤銷失敗!");
         die;
     }
 }
開發者ID:eliu03,項目名稱:fanweP2P,代碼行數:43,代碼來源:TransferAction.class.php

示例5: intval

 function do_reback()
 {
     $id = intval($_REQUEST['id']);
     if ($id == 0) {
         $this->error("操作失敗", 0);
         die;
     }
     $id = intval($_REQUEST['id']);
     $deal_id = $GLOBALS['db']->getOne("SELECT deal_id FROM " . DB_PREFIX . "deal_load_transfer WHERE id=" . $id);
     if ($deal_id == 0) {
         $this->error("不存在的債權");
         die;
     }
     $condition = ' AND dlt.id=' . $id . ' AND d.deal_status >= 4 and d.is_effect=1 and d.is_delete=0 and d.repay_time_type =1 and  d.publish_wait=0 ';
     $union_sql = " LEFT JOIN " . DB_PREFIX . "deal_load_transfer dlt ON dlt.deal_id = dl.deal_id ";
     $transfer = get_transfer($union_sql, $condition);
     if ($transfer['t_user_id'] > 0) {
         $this->error("債權已轉讓,無法撤銷", 0);
         die;
     }
     $msg = strim($_POST['msg']);
     if ($msg == "") {
         $this->error("請輸入撤銷原因", 0);
         die;
     }
     $GLOBALS['db']->query("UPDATE  " . DB_PREFIX . "deal_load_transfer SET status=0 WHERE id=" . $id);
     if ($GLOBALS['db']->affected_rows() > 0) {
         $content = "您好,您在" . app_conf("SHOP_TITLE") . "轉讓的債權 “<a href=\"" . url("index", "transfer#detail", array("id" => $id)) . "\">Z-" . $transfer['load_id'] . "</a>” 因為:“" . $msg . "”被管理員撤銷了";
         send_user_msg("", $content, 0, $transfer['user_id'], TIME_UTC, 0, true, 17);
         save_log("撤銷編號:{$id的債券轉讓}", 1);
         parent::success("撤銷成功!");
         die;
     } else {
         save_log("撤銷編號:{$id的債券轉讓}", 0);
         $this->error("撤銷失敗!");
         die;
     }
 }
開發者ID:norain2050,項目名稱:fanwei_xindai_3.2,代碼行數:38,代碼來源:TransferAction.class.php


注:本文中的CommonAction::success方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。