当前位置: 首页>>代码示例>>PHP>>正文


PHP material::delMaterialById方法代码示例

本文整理汇总了PHP中material::delMaterialById方法的典型用法代码示例。如果您正苦于以下问题:PHP material::delMaterialById方法的具体用法?PHP material::delMaterialById怎么用?PHP material::delMaterialById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在material的用法示例。


在下文中一共展示了material::delMaterialById方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: delete

 public function delete($ids)
 {
     if ($ids) {
         $sql = "SELECT logo_id FROM " . DB_PREFIX . "res_sort WHERE id IN(" . $ids . ")";
         $q = $this->db->query($sql);
         $mid = $space = '';
         while ($row = $this->db->fetch_array($q)) {
             $mid .= $space . $row['logo_id'];
             $space = ',';
         }
         $sql = "DELETE FROM " . DB_PREFIX . "res_sort WHERE id IN(" . $ids . ")";
         $this->db->query($sql);
         $sql = "DELETE FROM " . DB_PREFIX . "res WHERE sort_id IN(" . $ids . ")";
         //删除res对应子项目
         $this->db->query($sql);
         if ($mid) {
             include_once ROOT_PATH . 'lib/class/material.class.php';
             $mater = new material();
             $mater->delMaterialById($mid);
         }
         return array('id' => $ids);
     }
 }
开发者ID:h3len,项目名称:Project,代码行数:23,代码来源:res_sort.class.php

示例2: delete

 public function delete()
 {
     if (empty($this->input['id'])) {
         $this->errorOutput("ID不能为空");
     }
     $ids = urldecode($this->input['id']);
     include_once ROOT_PATH . 'lib/class/material.class.php';
     $material = new material();
     //删除圈子log
     $sql = "SELECT log FROM " . DB_PREFIX . "group WHERE id IN(" . $ids . ")";
     $q = $this->db->query($sql);
     while ($row = $this->db->fetch_array($q)) {
         $row['log'] = json_decode($row['log'], 1);
         if ($row['log']) {
             $material->delMaterialById($row['log'][0]['id'], 2);
         }
     }
     $sql = "DELETE FROM " . DB_PREFIX . "group WHERE id IN(" . $ids . ")";
     $this->db->query($sql);
     $this->addLogs('删除路况分类', '', '', '删除路况分类+' . $ids);
     $this->addItem($ids);
     $this->output();
 }
开发者ID:h3len,项目名称:Project,代码行数:23,代码来源:cat_update.php

示例3: dropImg

 /**
  * 删除图片
  */
 public function dropImg()
 {
     $id = intval($this->input['id']);
     if ($id <= 0) {
         $this->errorOutput(PARAM_WRONG);
     }
     $info = $this->company->detail('material', array('id' => $id));
     if (!$info) {
         $this->errorOutput(PARAM_WRONG);
     }
     include_once ROOT_PATH . 'lib/class/material.class.php';
     $material = new material();
     $material->delMaterialById($info['m_id']);
     $result = $this->company->delete('material', array('id' => $id));
     $this->addItem($result);
     $this->output();
 }
开发者ID:h3len,项目名称:Project,代码行数:20,代码来源:company_update.php

示例4: delete

 public function delete($ids)
 {
     if ($ids) {
         $sql = "SELECT material_id,sort_id,bill_id FROM " . DB_PREFIX . "bill_record WHERE id IN(" . $ids . ")";
         $q = $this->db->query($sql);
         $mid = $space = '';
         $bill_id = 0;
         $sort = array();
         while ($row = $this->db->fetch_array($q)) {
             $mid .= $space . $row['material_id'];
             $space = ',';
             if ($row['sort_id']) {
                 $sort[] = $row['sort_id'];
             }
             $bill_id = $row['bill_id'];
             //目前删除,批量删除,只能删除某个订单下的
         }
         if ($bill_id) {
             include_once CUR_CONF_PATH . 'lib/bill.class.php';
             $this->bill = new bill();
             $checkbool = $this->bill->checkLocked($bill_id);
             if ($checkbool) {
                 return array('error' => THIS_IS_LOCKED);
             }
         }
         $sql = "DELETE FROM " . DB_PREFIX . "bill_record WHERE id IN(" . $ids . ")";
         $this->db->query($sql);
         /****删除成功成功执行以下操作*****/
         if ($mid) {
             include_once ROOT_PATH . 'lib/class/material.class.php';
             $mater = new material();
             $mater->delMaterialById($mid);
         }
         if ($sort) {
             foreach ($sort as $key => $value) {
                 $this->updateSortCount($value, -1);
             }
         }
         /*****end******/
         return array('id' => $ids, 'bill_id' => $bill_id);
     }
 }
开发者ID:h3len,项目名称:Project,代码行数:42,代码来源:bill_record.class.php

示例5: delete_image

 /**
  * 删除上传图片
  * @param $id int 图片ID
  */
 private function delete_image($id)
 {
     if (!$id) {
         return false;
     }
     $sql = "SELECT mid FROM " . DB_PREFIX . "material WHERE id in (" . $id . ")";
     $q = $this->db->query($sql);
     while ($r = $this->db->fetch_array($q)) {
         $mid[] = $r['mid'];
     }
     $mid = implode(',', $mid);
     $sql = "DELETE FROM " . DB_PREFIX . "material WHERE id in (" . $id . ")";
     $data = $this->db->query_first($sql);
     if ($mid) {
         include_once ROOT_PATH . 'lib/class/material.class.php';
         $material_pic = new material();
         $material_pic->delMaterialById($mid);
     }
     return $id;
 }
开发者ID:h3len,项目名称:Project,代码行数:24,代码来源:vote_question_update.php

示例6: dropMaterial

 /**
  * 删除图片素材信息
  */
 public function dropMaterial()
 {
     $pid = isset($this->input['p_id']) ? intval($this->input['p_id']) : '';
     if (empty($pid)) {
         $this->errorOutput(PARAM_WRONG);
     }
     $info = $this->status->getMaterial($pid, $this->user['user_id']);
     if (!$info) {
         $this->errorOutput(OBJECT_NULL);
     }
     //删除本地图片信息
     $result = $this->status->delete('material', array('id' => $pid));
     //删除图片服务器上的信息
     include_once ROOT_PATH . 'lib/class/material.class.php';
     $material = new material();
     $material->delMaterialById($info['material_id'], 2);
     $this->addItem($result);
     $this->output();
 }
开发者ID:h3len,项目名称:Project,代码行数:22,代码来源:update.php

示例7: delete

 public function delete()
 {
     if (empty($this->input['id'])) {
         $this->errorOutput("ID不能为空");
     }
     $ids = urldecode($this->input['id']);
     include_once ROOT_PATH . 'lib/class/material.class.php';
     $material = new material();
     //删除圈子log
     $sql = "SELECT log FROM " . DB_PREFIX . "circle WHERE id IN(" . $ids . ")";
     $q = $this->db->query($sql);
     while ($row = $this->db->fetch_array($q)) {
         $row['log'] = json_decode($row['log'], 1);
         if ($row['log']) {
             $material->delMaterialById($row['log'][0]['id'], 2);
         }
     }
     $sql = "DELETE FROM " . DB_PREFIX . "circle WHERE id IN(" . $ids . ")";
     $this->db->query($sql);
     $sql = "DELETE FROM " . DB_PREFIX . "weibo_circle WHERE circle_id IN(" . $ids . ")";
     $this->db->query($sql);
     //修改用户表中的溶于数据
     $sql = "SELECT user_id FROM " . DB_PREFIX . "user_circle WHERE circle_id IN(" . $ids . ")";
     $ret = $this->db->query($sql);
     $user_id = array();
     while ($row = $this->db->fetch_array($ret)) {
         $user_id[] = $row['user_id'];
     }
     $user_id = $user_id && is_array($user_id) ? implode(',', $user_id) : $user_id;
     $this->update_user($user_id, $ids);
     $sql = "DELETE FROM " . DB_PREFIX . "user_circle WHERE circle_id IN(" . $ids . ")";
     $this->db->query($sql);
     $this->addLogs('删除微博圈', '', '', '删除微博圈+' . $ids);
     $this->addItem($ids);
     $this->output();
 }
开发者ID:h3len,项目名称:Project,代码行数:36,代码来源:wbcircle_update.php


注:本文中的material::delMaterialById方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。