本文整理汇总了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);
}
示例2: getHomeByHomeIdArr
public function getHomeByHomeIdArr($homeIdArr)
{
$tableName = utils::getTableName('home');
$homeIdStr = implode(',', $homeIdArr);
$homeInfoList = $this->querySql($tableName, array('*'), 'id in (' . $homeIdStr . ')');
return $homeInfoList;
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
}
示例7: getProductListByOrderIds
public function getProductListByOrderIds($ids)
{
$tableName = utils::getTableName($this->modelName);
$productResult = $this->model->querySql($tableName, array('*'), 'order_id in (' . implode(',', $ids) . ')');
return $productResult;
}
示例8: getHomeByIds
public function getHomeByIds($ids)
{
$tableName = utils::getTableName($this->modelName);
$shopList = $this->model->querySql($tableName, array('*'), 'id in (' . implode(',', $ids) . ')');
return $shopList;
}