Beispiel #1
0
 public function recipientPost()
 {
     if ($this->user) {
         core::outPut(1);
     } else {
         core::outPut(1001, "Please login");
     }
 }
Beispiel #2
0
 /**
  * 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);
     }
 }
Beispiel #3
0
 /**
  * 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);
     }
 }
Beispiel #4
0
 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");
     }
 }
Beispiel #5
0
 /**
  * api: en.facebook.getFreeSampleInfo
  */
 public function getFreeSampleInfo()
 {
     $result = $this->model->getFreeSampleInfo();
     if ($result) {
         core::outPut(1, $result);
     } else {
         core::outPut(-1);
     }
 }
Beispiel #6
0
 /**
  * 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);
     }
 }
Beispiel #7
0
 /**
  * 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);
     }
 }