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


PHP utils::getTableName方法代码示例

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


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

示例1: index

 public function index()
 {
     $this->actionMenu = array(array('name' => '发布商品', 'url' => utils::getUrl('admin/system-product/add/' . base64_encode($this->url))));
     $this->menuTitle = '我的商品列表';
     $tableName = utils::getTableName($this->systemProductService->modelName);
     $systemProductList = $this->systemProductService->model->querySql($tableName);
     $hasSkuProductIdArr = $newProductList = array();
     if ($systemProductList) {
         foreach ($systemProductList['resultList'] as $product) {
             $newProductList[$product['id']] = $product;
             if ($product['is_has_sku']) {
                 $hasSkuProductIdArr[] = $product['id'];
             }
         }
     }
     $productSkuService = new productSkuService();
     $skuList = $productSkuService->getSkuListByProductIdArr($hasSkuProductIdArr);
     if ($skuList) {
         foreach ($skuList as $skuInfo) {
             $newProductList[$skuInfo['sysproduct_id']]['skuList'][] = $skuInfo;
         }
     }
     $showCategoryModel = new showCategoryModel();
     $showCategoryList = $showCategoryModel->getCacheFileCategory();
     $productAllStatus = $this->systemProductService->productStatus;
     $data = array('showCategoryList' => $showCategoryList, 'systemProductList' => $newProductList, 'productAllStatus' => $productAllStatus);
     $this->setView($data);
 }
开发者ID:lzmyoyo,项目名称:ninxingfu,代码行数:28,代码来源:systemProductController.php

示例2: getHomeByHomeIdArr

 public function getHomeByHomeIdArr($homeIdArr)
 {
     $tableName = utils::getTableName('home');
     $homeIdStr = implode(',', $homeIdArr);
     $homeInfoList = $this->querySql($tableName, array('*'), 'id in (' . $homeIdStr . ')');
     return $homeInfoList;
 }
开发者ID:lzmyoyo,项目名称:ninxingfu,代码行数:7,代码来源:homeModel.php

示例3: getSkuListByProductIdArr

 public function getSkuListByProductIdArr($productIdArr)
 {
     $allSkuList = array();
     if ($productIdArr) {
         $productIdStr = implode(',', $productIdArr);
         $where = "sysproduct_id in ({$productIdStr})";
         $skuList = $this->model->querySql(utils::getTableName($this->modelName), array('*'), $where);
         if ($skuList['rowNums']) {
             $allSkuList = $skuList['resultList'];
         }
     }
     return $allSkuList;
 }
开发者ID:lzmyoyo,项目名称:ninxingfu,代码行数:13,代码来源:systemProductSkuService.php

示例4: getSkuByIds

 public function getSkuByIds($skuIds)
 {
     $allSkuList = array();
     if ($skuIds) {
         $skuIdStr = implode(',', $skuIds);
         $where = "id in ({$skuIdStr})";
         $skuList = $this->model->querySql(utils::getTableName($this->modelName), array('*'), $where);
         if ($skuList['rowNums']) {
             $allSkuList = $skuList['resultList'];
         }
     }
     return $allSkuList;
 }
开发者ID:lzmyoyo,项目名称:ninxingfu,代码行数:13,代码来源:productSkuService.php

示例5: addToCart

 public function addToCart($prodcutInfo, $nums = 1, $groupNum = 1, $groupDay = 1, $startTimeInt = 0, $skuInfo = 0)
 {
     $userId = 1;
     //判断购物车是否含有该商品
     $hasCartId = $this->checkProductIsCart($prodcutInfo['id'], $skuInfo['id']);
     if ($hasCartId) {
         $tableName = utils::getTableName($this->modelName);
         $sql = 'update ' . $tableName . ' set product_num = product_num + ' . $nums . ',group_num=' . $groupNum . ',group_day=' . $groupDay . ',start_time=' . $startTimeInt . ' where id = ' . $hasCartId;
         $this->model->executeSql($sql);
         $cartId = $hasCartId;
     } else {
         $saveData = array('product_id' => $prodcutInfo['id'], 'price' => $prodcutInfo['price'], 'product_num' => $nums, 'paddtime' => time(), 'user_id' => $userId, 'group_num' => $groupNum, 'group_day' => $groupDay, 'start_time' => $startTimeInt);
         if ($skuInfo) {
             $saveData['price'] = $skuInfo['price'];
             $saveData['sku_id'] = $skuInfo['id'];
         }
         $cartId = $this->model->insert($saveData);
     }
     return $cartId;
 }
开发者ID:lzmyoyo,项目名称:ninxingfu,代码行数:20,代码来源:cartService.php

示例6: cancelOrder

 public function cancelOrder($id, $cancelOrderVal)
 {
     //判断订单是否在线支付,是否需要退款
     $orderInfo = $this->model->find($id);
     //订单有效判断
     $sessionUser = utils::getSessionVal('userInfo');
     $cancelStatus = array(1, 2, 3, 4);
     if (!in_array($orderInfo['pstatus'], $cancelStatus)) {
         return array('code' => '201', 'message' => '订单状态错误');
     }
     if ($orderInfo['shop_id'] != $sessionUser['shopId']) {
         return array('code' => '201', 'message' => '非法操作,你无权操作');
     }
     $returnPrice = false;
     if ($orderInfo['pay_status'] == 1) {
         $returnPrice = true;
     }
     $db = utils::getDB();
     $db->beginTransaction();
     $sessionUser['businessUserId'] = 6;
     $tableName = utils::getTableName('user');
     $sql = 'update ' . $tableName . ' set balance = balance - ' . $orderInfo['actual_total'] . ' where id = ' . $sessionUser['businessUserId'];
     $isTure = $this->model->executeSql($sql);
     if ($isTure) {
         $saveOrderData = array('id' => $orderInfo['id'], 'pstatus' => 6, 'actual_total' => 0, 'pay_status' => 3);
         $orderService = utils::getService('order');
         $orderService->model->save($saveOrderData);
         $db->commit();
     } else {
         $db->rollBack();
     }
 }
开发者ID:lzmyoyo,项目名称:ninxingfu,代码行数:32,代码来源:orderService.php

示例7: getProductListByOrderIds

 public function getProductListByOrderIds($ids)
 {
     $tableName = utils::getTableName($this->modelName);
     $productResult = $this->model->querySql($tableName, array('*'), 'order_id in (' . implode(',', $ids) . ')');
     return $productResult;
 }
开发者ID:lzmyoyo,项目名称:ninxingfu,代码行数:6,代码来源:orderProductService.php

示例8: getHomeByIds

 public function getHomeByIds($ids)
 {
     $tableName = utils::getTableName($this->modelName);
     $shopList = $this->model->querySql($tableName, array('*'), 'id in (' . implode(',', $ids) . ')');
     return $shopList;
 }
开发者ID:lzmyoyo,项目名称:ninxingfu,代码行数:6,代码来源:homeService.php


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