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


PHP Products::setWhere方法代码示例

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


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

示例1: index

 /**
  * 返回国家列表
  * @access public
  */
 function index()
 {
     $key = strtolower(get_post_value('key'));
     $field = array('product_url', 'title_cn', 'title_th', 'category_3_id', 'floor_3_id', 'image_url', 'product_url', 'shop', 'shop_id', 'shop_url', 'product_id', 'status', 'category_1_id', 'sales_price');
     $m = new Products();
     $m->clear();
     $m->setTable('vcb_product');
     //设置表名
     $m->setField($field);
     $m->setWhere('title_cn', 'LIKE', '%' . $key . '%', 'and', '(');
     $m->setWhere('title_th', 'LIKE', '%' . $key . '%', 'or');
     $m->setWhere('shop', 'LIKE', '%' . $key . '%', 'or', ')');
     $count = $m->getRowsCount();
     //var_dump($count);
     $page = new Page($count, 5);
     $parameter = array();
     $page->setParameter($parameter);
     $showPage = $page->showPage();
     $showTotal = $page->showTotal();
     /*var_dump($showPage);
     		var_dump($showTotal);*/
     $m->setPage();
     $page->setListRows(5);
     $m->setLimit($page->listRows);
     $data = $m->select();
     $this->assign('data', $data);
     $this->assign('key', $key);
     $this->assign('showPage', $showPage);
     //输出分页
     $this->assign('showTotal', $showTotal);
 }
开发者ID:koery,项目名称:Vcanbuy,代码行数:35,代码来源:SearchController.class.php

示例2: array

 function get_size()
 {
     $id = get_post_value("id");
     $field = array('id', 'size', 'sku');
     $m = new Products();
     $m->clear();
     $m->setTable(' vcb_product_ksize ');
     //设置表名
     $m->setField($field);
     $m->setWhere('product_kind_id', '=', $id);
     $data = $m->select();
     $this->assign('json', $data);
     $this->setReturnType('json');
 }
开发者ID:koery,项目名称:Vcanbuy,代码行数:14,代码来源:ProinfoController1.class.php

示例3: trim

 /**
  * 更新国家信息
  * @access public
  */
 function update_save()
 {
     $id = get_post_value('product_id');
     $product_url = get_post_value('product_url');
     $title_cn = get_post_value('title_cn');
     $title_th = get_post_value('title_th');
     $category_1 = get_post_value('category_1');
     $category_2 = get_post_value('category_2');
     $category_3 = get_post_value('category_3');
     $floor_1 = get_post_value('floor_1');
     $floor_2 = get_post_value('floor_2');
     $floor_3 = get_post_value('floor_3');
     $purchase_price = trim(get_post_value('purchase_price'));
     $sales_price = trim(get_post_value('sales_price'));
     $start_time = get_post_value('start_time');
     $end_time = get_post_value('end_time');
     $image_url = trim(get_post_value('image_url')) == '' ? get_post_value('image_url_old') : get_post_value('image_url');
     $product_url = get_post_value('product_url');
     $shop_id = get_post_value('shop_id');
     $shop = get_post_value('shop');
     $shop_url = get_post_value('shop_url');
     $preferential_price = get_post_value('preferential_price');
     $field = array('title_cn' => trim($title_cn), 'title_th' => trim($title_th), 'category_3_id' => trim($category_3), 'floor_3_id' => trim($floor_3), 'purchase_price' => intval($purchase_price), 'sales_price' => intval($sales_price), 'preferential_price' => intval($preferential_price), 'image_url' => trim($image_url), 'product_url' => trim($product_url), 'shop' => trim($shop), 'start_time' => $start_time, 'end_time' => $end_time, 'hits' => '0', 'buys' => '0', 'favorites' => '0', 'created' => time(), 'created_name' => '', 'upload_name' => '', 'status' => '10000', 'category_1_id' => $category_1);
     $m = new Products();
     $m->clear();
     $m->setTable('vcb_product');
     //设置表名
     $m->setField($field);
     ///设置更新字段及值,(键值数组)
     $m->setWhere('product_id', '=', $id);
     //设置Where条件
     $m->update();
     //返回
     echo '<br>操作成功,<a href="index" >返回</a><br>';
 }
开发者ID:koery,项目名称:Vcanbuy,代码行数:39,代码来源:ProductsController.class.php

示例4: verify_kind

 private function verify_kind($id)
 {
     $m = new Products();
     $field = array('id');
     $m->clear();
     $m->setField($field);
     $m->setTable(' vcb_product_kind ');
     $m->setWhere('id', ' = ', $id);
     $data = $m->select();
     return $data;
 }
开发者ID:koery,项目名称:Vcanbuy,代码行数:11,代码来源:ProductsController2015312.class.php

示例5: addtaobaosave

 function addtaobaosave()
 {
     $product_url = get_post_value('product_url');
     $title_cn = get_post_value('title_cn');
     $title_th = get_post_value('title_th');
     $category_1 = get_post_value('category_1');
     $category_2 = get_post_value('category_2');
     $category_3 = get_post_value('category_3');
     $floor_1 = get_post_value('floor_1');
     $floor_2 = get_post_value('floor_2');
     $floor_3 = get_post_value('floor_3');
     $purchase_price = trim(get_post_value('purchase_price'));
     $sales_price = trim(get_post_value('sales_price'));
     $start_time = get_post_value('start_time');
     $end_time = get_post_value('end_time');
     $image_url = get_post_value('image_url');
     $product_url = get_post_value('product_url');
     $shop_id = get_post_value('shop_id');
     $shop = get_post_value('shop');
     $shop_url = get_post_value('shop_url');
     $preferential_price = get_post_value('preferential_price');
     $shop_img = get_post_value('shop_img');
     $type0 = get_post_value('type0');
     $type1 = get_post_value('type1');
     $type2 = get_post_value('type2');
     $location = get_post_value('location');
     $imgsrc = get_post_value('imgsrc');
     $imgsrc = explode('|', $imgsrc);
     $array_type0 = explode('|', $type0);
     $array_type1 = explode('|', $type1);
     $array_type2 = explode('|', $type2);
     $now = date('Y');
     $p_name = time() . ".png";
     $p_url_ = "Upload/Products/" . date('Y') . "/" . date('m') . "/" . date('d') . "/";
     $purl_ = "Products/" . date('Y') . "/" . date('m') . "/" . date('d') . "/";
     get_file($shop_img, $p_url_, $p_name);
     $field = array('product_url' => trim($product_url), 'title_cn' => trim($title_cn), 'title_th' => trim($title_th), 'category_1_cn' => trim($category_1), 'category_2_cn' => trim($category_2), 'category_3_cn' => trim($category_3), 'floor_3_id' => trim($floor_3), 'purchase_price' => intval($purchase_price), 'sales_price' => intval($sales_price), 'preferential_price' => intval($preferential_price), 'old_price' => intval($preferential_price), 'image_path' => $purl_ . $p_name, 'shop' => trim($shop), 'start_time' => $start_time, 'end_time' => $end_time, 'hits' => '0', 'buys' => '0', 'favorites' => '0', 'created' => date('Y-m-d H:i:s', time()), 'created_name' => '', 'upload_name' => '', 'status' => '10000');
     $m = new Products();
     $m->clear();
     $m->setTable('vcb_product');
     //设置表名
     $m->setField($field);
     //设置更新字段及值,(键值数组)
     $data1 = $m->insert();
     //插入数据
     $field = array('product_id');
     $m->clear();
     $m->setField($field);
     $m->setTable('vcb_product');
     $m->setWhere('image_path', '=', $purl_ . $p_name);
     $data = $m->select();
     $product_id = $data[0]['product_id'];
     //这部分得修改aa:aa01|bb:bb01|cc:cc01
     foreach ($array_type0 as $key => $type0) {
         foreach ($array_type1 as $type1) {
             foreach ($array_type2 as $type2) {
                 $sku_name_cn = "颜色:" . $type0 . "|尺码:" . $type1 . "|重量:5kg";
                 $field = array('product_id' => $product_id, 'sku_code' => 'aa:aa01|bb:bb01|cc:cc01', 'sku_name_cn' => $sku_name_cn, 'sku_name_th' => NULL, 'sku_name_en' => NULL, 'qty' => '100', 'sales_price' => '1000', 'old_price' => '800');
                 $m->clear();
                 $m->setTable('vcb_product_sku');
                 $m->setField($field);
                 $data2 = $m->insert();
             }
         }
     }
     //这部分得修改aa:aa01|bb:bb01|cc:cc01
     for ($i = 0; $i < 1; $i++) {
         get_file($shop_img, $p_url_, $p_name . $i);
         $field = array('product_id' => $product_id, 'imgShowPath' => $purl_ . $p_name, 'imgDetailPath' => $purl_ . $p_name);
         $m->clear();
         $m->setTable('vcb_product_img_detail');
         $m->setField($field);
         $data3 = $m->insert();
     }
     //插入数据是否成功。
     if ($data1 && $data2 && $data3) {
         echo '<br>保存成功,<a href="add1">继续添加</a>,<a href="index">返回</a><br>';
     } else {
         echo '<br>保存失败<br>';
     }
 }
开发者ID:koery,项目名称:Vcanbuy,代码行数:81,代码来源:ProductsController.class.php

示例6: array

 function get_orders()
 {
     $id = get_post_value("id");
     $order = get_post_value('order');
     $field = array('product_url', 'title_cn', 'title_th', 'category_3_id', 'floor_3_id', 'purchase_price', 'image_url', 'sales_price', 'product_url', 'shop', 'shop_id', 'shop_url', 'product_id', 'status', 'buys', 'category_1_id');
     $m = new Products();
     $m->clear();
     $m->setTable('vcb_product');
     //设置表名
     $m->setField($field);
     $count = $m->getRowsCount();
     //var_dump($count);
     $page = new Page($count, 2);
     $parameter = array();
     $page->setParameter($parameter);
     $showPage = $page->showPage();
     $showTotal = $page->showTotal();
     //var_dump($showPage);
     //var_dump($showTotal);
     $m->setPage();
     $page->setListRows(2);
     $m->setWhere('category_1_id', '=', $id);
     $m->setLimit($page->listRows);
     $m->setOrderBy(array($order => 'DESC'));
     $data = $m->select();
     $this->assign('data', $data);
 }
开发者ID:koery,项目名称:Vcanbuy,代码行数:27,代码来源:InlistController.class.php


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