本文整理匯總了PHP中core::outPut方法的典型用法代碼示例。如果您正苦於以下問題:PHP core::outPut方法的具體用法?PHP core::outPut怎麽用?PHP core::outPut使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類core
的用法示例。
在下文中一共展示了core::outPut方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: recipientPost
public function recipientPost()
{
if ($this->user) {
core::outPut(1);
} else {
core::outPut(1001, "Please login");
}
}
示例2: get
/**
* api:en.goodsTag.get
* 功能:根據商品id獲取商品信息
* 調用:CT_Api::get();
* 參數:$id:商品id
*/
public function get()
{
$id = core::getInput("id");
$data = $this->model->get($id);
if ($data) {
//存在
core::outPut(1, $data);
} else {
//不存在
core::outPut(-1);
}
}
示例3: delete
/**
* api: en.info.delete
* 功能:刪除商品描述信息
* 調用:CT_Api::post();
* 參數:$id: 商品id
*/
public function delete()
{
$id = core::getInput("id");
$result = $this->model->delete($id);
if ($result) {
//存在
core::outPut(1, $result);
} else {
//不存在
core::outPut(-1);
}
}
示例4: postComments
public function postComments()
{
if ($this->user) {
$user_id = $this->user['id'];
$goods_id = $_POST['goods_id'];
$the_date = $_POST['the_date'];
$starts = $_POST['starts'];
$comments = $_POST['comments'];
if (!verify::vIsNNUll($comments)) {
core::outPut(-1, "評論內容輸入不能為空");
}
if (!verify::vIsNumber($starts)) {
core::outPut(-1, "評論星級選擇不能為空");
}
if (!verify::vIsNumber($goods_id)) {
core::outPut(-1, "商品ID不能為空");
}
//先判斷該用戶是否有購買過該商品
$this->CT_Api->api = "en.order.checkComments";
$this->CT_Api->user_id = $user_id;
$this->CT_Api->goods_id = $goods_id;
$result = $this->CT_Api->get();
if ($result != 1) {
core::outPut(-1, "必須購買了該產品才能評論");
}
$this->CT_Api->api = "en.comments.save";
$this->CT_Api->setParams(array('line_id' => $result['response']['id'], 'user_id' => $user_id, 'goods_id' => $goods_id, 'the_date' => $the_date, 'starts' => $starts, 'content' => $comments));
$result = $this->CT_Api->post();
if ($result['code'] == 1) {
core::outPut(1, "評論發表成功");
} else {
core::outPut(-1);
}
} else {
core::outPut(1001, "Please login");
}
}
示例5: getFreeSampleInfo
/**
* api: en.facebook.getFreeSampleInfo
*/
public function getFreeSampleInfo()
{
$result = $this->model->getFreeSampleInfo();
if ($result) {
core::outPut(1, $result);
} else {
core::outPut(-1);
}
}
示例6: getAmount
/**
* api: en.order.getAmount
* 功能:獲取購物車商品總金額
* 調用:CT_Api::get();
* 參數:$goods_qty: 購物車商品串
*/
public function getAmount()
{
$goods_qty = core::getInput("goods_qty");
$data = $this->model->getAmount($goods_qty);
if ($data) {
core::outPut(1, $data);
} else {
core::outPut(-1);
}
}
示例7: deleteMsgs
/**
* api£º en.userMessages.deleteMsgs
* function£ºdelete messages
* call£ºCT_Api::post();
* param£º$ids: message ids array() (must be assigned)
*
* Note: $mode and $uid must be assigned before $ids
*/
public function deleteMsgs()
{
$data = core::getInput();
$mode = $data['mode'];
$uid = $data['uid'];
$ids = $data['id'];
if (!$ids) {
if ($uid) {
$ids = array_slice($data, 3, -4);
} else {
$ids = array_slice($data, 2, -4);
}
}
$result = $this->model->deleteMsgs($ids, $mode, $uid);
if ($result) {
//Exist
core::outPut(1, $result);
} else {
//Not exist
core::outPut(-1);
}
}