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


PHP OmAvailableModel::getTrueSkuForCombine方法代码示例

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


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

示例1: content_526616c3586904_20926076

    function content_526616c3586904_20926076($_smarty_tpl)
    {
        if (!is_callable('smarty_modifier_date_format')) {
            include 'D:\\wamp\\www\\ftpPc.valsun.cn\\lib\\template\\smarty\\plugins\\modifier.date_format.php';
        }
        echo $_smarty_tpl->getSubTemplate("header.htm", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);
        ?>

<script type="text/javascript" src="./js/goodslist.js"></script>
<div class="fourvar">
            	<div class="pathvar">
                <?php 
        echo $_smarty_tpl->getSubTemplate('pcNav.htm', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);
        ?>

                </div>
                <div class="texvar">
                </div>
                <div class="pagination">
                <?php 
        echo $_smarty_tpl->tpl_vars['show_page']->value;
        ?>

                </div>
            </div>
			<div class="servar products-servar">
								  <span>SPU:
								   <input name="combineSpu" type="combineSpu" id="combineSpu" value="<?php 
        echo $_GET['combineSpu'];
        ?>
"/>
								   </span>
                                   <span><button id='searchCombineList'/>搜索</button></span>
                                   &nbsp;
                                   <span style="color: red;" id="error"><?php 
        echo $_GET['status'];
        ?>
</span>
            </div>
            <div class="main feedback-main" >
            	<table class="products-action" cellspacing="0" width="100%">
                   <tr class="title">
					    <td>SPU</td>
                        <td>SKU</td>
                        <td>成本</td>
						<td>重量</td>
                        <td>真实料号</td>
						<td>长</td>
						<td>宽</td>
						<td>高</td>
						<td>备注</td>
						<td>组合人</td>
						<td>添加时间</td>
                        <td>操作</td>
                    </tr>
                    <?php 
        $_smarty_tpl->tpl_vars['value'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['value']->_loop = false;
        $_from = $_smarty_tpl->tpl_vars['combineList']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['value']->key => $_smarty_tpl->tpl_vars['value']->value) {
            $_smarty_tpl->tpl_vars['value']->_loop = true;
            ?>
                                <tr id="<?php 
            echo $_smarty_tpl->tpl_vars['value']->value['id'];
            ?>
">
									<td>
									   <?php 
            echo $_smarty_tpl->tpl_vars['value']->value['combineSpu'];
            ?>

									</td>
                                    <td><?php 
            echo $_smarty_tpl->tpl_vars['value']->value['combineSku'];
            ?>
</td>
                                    <td><?php 
            echo $_smarty_tpl->tpl_vars['value']->value['combineCost'];
            ?>
</td>
									<td><?php 
            echo $_smarty_tpl->tpl_vars['value']->value['combineWeight'];
            ?>
</td>
                                    <td>
                                    <?php 
            $_smarty_tpl->tpl_vars['vv'] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars['vv']->_loop = false;
            $_from = OmAvailableModel::getTrueSkuForCombine($_smarty_tpl->tpl_vars['value']->value['combineSku']);
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars['vv']->key => $_smarty_tpl->tpl_vars['vv']->value) {
                $_smarty_tpl->tpl_vars['vv']->_loop = true;
                ?>
                                      <?php 
                echo $_smarty_tpl->tpl_vars['vv']->value['sku'];
//.........这里部分代码省略.........
开发者ID:ohjack,项目名称:newErp,代码行数:101,代码来源:5b1a6b47bde6e55476bf39d54ad2996b29922b3a.file.combineList.htm.php

示例2: getTruePMCWForCombineSku

function getTruePMCWForCombineSku($combineSku)
{
    $trueSkuList = OmAvailableModel::getTrueSkuForCombine($combineSku);
    if (empty($trueSkuList)) {
        return 0;
    }
    $countTrueSkuList = count($trueSkuList);
    $array = array();
    $pmTotalCost = 0;
    //包材总成本
    $pmTotalWeight = 0;
    //包材总重量
    foreach ($trueSkuList as $value) {
        $sku = $value['sku'];
        $count = intval($value['count']);
        $tName = 'pc_goods';
        $select = 'pmId,pmCapacity';
        $where = "WHERE sku='{$sku}'";
        $skuList = OmAvailableModel::getTNameList($tName, $select, $where);
        $pmId = $skuList[0]['pmId'];
        $pmId = intval($pmId);
        //取得对应sku的pmId,和pmCapacity
        $pmCapacity = $skuList[0]['pmCapacity'];
        $pmCapacity = intval($pmCapacity) ? intval($pmCapacity) : 1;
        //容量为空,则默认为1
        if ($pmId > 0) {
            $tName = 'pc_packing_material';
            $select = 'pmName,pmWeight,pmCost';
            $where = "WHERE id='{$pmId}'";
            $pmList = OmAvailableModel::getTNameList($tName, $select, $where);
            if (!empty($pmList)) {
                $pmName = $pmList[0]['pmName'];
                //包材名称
                $pmWeight = $pmList[0]['pmWeight'];
                //该真实sku下对应包材重量
                $pmCost = $pmList[0]['pmCost'];
                //该真实sku下对应包材价格
                //下面求出该真实料号及数量要对应包材的个数
                $pmCount = ceil($count / $pmCapacity);
                //sku数量/包材容量,取整 得到包材个数
                $pmTotalCost += $pmCost * $pmCount;
                $pmTotalWeight += $pmWeight * $pmCount;
            }
        }
    }
    $array['pmTotalCost'] = $pmTotalCost / $countTrueSkuList;
    $array['pmTotalWeight'] = $pmTotalWeight / $countTrueSkuList;
    return $array;
}
开发者ID:ohjack,项目名称:newErp,代码行数:49,代码来源:functions.php

示例3: view_getCombineList

 public function view_getCombineList()
 {
     //调用action层, 获取列表数据
     $searchComField = isset($_GET['searchComField']) ? post_check($_GET['searchComField']) : '';
     $fieldValue = isset($_GET['fieldValue']) ? post_check($_GET['fieldValue']) : '';
     $flag = false;
     $tName = 'pc_goods_combine';
     $where = 'where is_delete=0 ';
     if (!empty($fieldValue)) {
         if (intval($searchComField) == 1) {
             $where .= "and combineSpu='{$fieldValue}' ";
             $flag = true;
         } elseif (intval($searchComField) == 2) {
             $tmpTName = 'pc_sku_combine_relation';
             $tmpSelect = 'combineSku';
             $tmpWhere = "WHERE sku REGEXP '^{$fieldValue}(_[A-Z0-9]+)*\$'";
             $combineSkuList = OmAvailableModel::getTNameList($tmpTName, $tmpSelect, $tmpWhere);
             $combineSkuArr = array();
             foreach ($combineSkuList as $value) {
                 if (!empty($value['combineSku'])) {
                     $combineSkuArr[] = "'" . $value['combineSku'] . "'";
                 }
             }
             if (!empty($combineSkuArr)) {
                 $combineSkuStr = implode(',', $combineSkuArr);
                 $where .= "and combineSku in({$combineSkuStr}) ";
                 $flag = true;
             } else {
                 $where .= "and 1=0 ";
                 $flag = true;
             }
         }
     }
     $total = OmAvailableModel::getTNameCount($tName, $where);
     $num = 50;
     //每页显示的个数
     $page = new Page($total, $num, '', 'CN');
     $where .= "order by combineSpu desc " . $page->limit;
     $select = '*';
     if ($flag == false) {
         $combineList = array();
     } else {
         $combineList = OmAvailableModel::getTNameList($tName, $select, $where);
     }
     if (!empty($_GET['page'])) {
         if (intval($_GET['page']) <= 1 || intval($_GET['page']) > ceil($total / $num)) {
             $n = 1;
         } else {
             $n = (intval($_GET['page']) - 1) * $num + 1;
         }
     } else {
         $n = 1;
     }
     if ($total > $num) {
         //输出分页显示
         $show_page = $page->fpage(array(0, 2, 3, 4, 5, 6, 7, 8, 9));
     } else {
         $show_page = $page->fpage(array(0, 2, 3));
     }
     $navlist = array(array('url' => 'index.php?mod=goods&act=getGoodsList', 'title' => '产品信息'), array('url' => 'index.php?mod=goods&act=getCombineList', 'title' => '虚拟料号管理'));
     $this->smarty->assign('navlist', $navlist);
     $this->smarty->assign('onevar', 1);
     $this->smarty->assign('twovar', 12);
     $this->smarty->assign('show_page', $show_page);
     $this->smarty->assign('title', '虚拟料号列表');
     if (!empty($combineList)) {
         $countCombineList = count($combineList);
         for ($i = 0; $i < $countCombineList; $i++) {
             if ($i > 0 && $combineList[$i]['combineSpu'] == $combineList[$i - 1]['combineSpu']) {
                 $combineList[$i]['visibleSpu'] = '';
             } else {
                 $combineList[$i]['visibleSpu'] = $combineList[$i]['combineSpu'];
             }
             $combineSku = $combineList[$i]['combineSku'];
             $cwArr = getTrueCWForCombineSku($combineSku);
             //根据combineSku返回真实的成本及重量
             $combineList[$i]['totalCost'] = $cwArr['totalCost'];
             $combineList[$i]['totalWeight'] = $cwArr['totalWeight'];
             $trueSkuList = OmAvailableModel::getTrueSkuForCombine($combineSku);
             //获取真实料号数组
             $combineList[$i]['trueSkuListCount'] = count($trueSkuList);
             for ($j = 0; $j < $combineList[$i]['trueSkuListCount']; $j++) {
                 $tName = 'pc_goods';
                 $select = 'goodsName';
                 $where = "WHERE sku='{$trueSkuList[$j]['sku']}'";
                 $goodsNameList = OmAvailableModel::getTNameList($tName, $select, $where);
                 $goodsName = $goodsNameList[0]['goodsName'];
                 $trueSkuList[$j]['goodsName'] = $goodsName;
             }
             $combineList[$i]['trueSkuList'] = $trueSkuList;
         }
     }
     $this->smarty->assign('combineList', empty($combineList) ? null : $combineList);
     $this->smarty->display("combineList.htm");
 }
开发者ID:ohjack,项目名称:newErp,代码行数:95,代码来源:goods.view.php

示例4: content_52664d93244fa3_30432969


//.........这里部分代码省略.........
        ?>
" disabled="disabled"/>
                            <input name="id" value="<?php 
        echo $_smarty_tpl->tpl_vars['combine']->value['id'];
        ?>
" type="hidden"/>
                            <input name="combineSpu" value="<?php 
        echo $_smarty_tpl->tpl_vars['combine']->value['combineSpu'];
        ?>
" type="hidden"/>
                        </td>
                    </tr>
                    <tr>
                        <td ><span style="color:#F00;">*</span>SKU</td>
                        <td><input class="validate[required]" name="combineSku" id="combineSku" value="<?php 
        echo $_smarty_tpl->tpl_vars['combine']->value['combineSku'];
        ?>
"/></td>
                    </tr>
                    <tr>
                        <td><span style="color:#F00;">*</span>成本</td>
                        <td><input class="validate[required,custom[number],min[0.001]] text-input" name="combineCost" id="combineCost" value="<?php 
        echo $_smarty_tpl->tpl_vars['combine']->value['combineCost'];
        ?>
"/></td>

                    </tr>
                    <tr>
                        <td><span style="color:#F00;">*</span>重量</td>
                        <td><input class="validate[required,custom[number],min[0.001]] text-input" name="combineWeight" id="combineWeight" value="<?php 
        echo $_smarty_tpl->tpl_vars['combine']->value['combineWeight'];
        ?>
"/></td>
                    </tr>
                    <tr>
                        <td><span style="color:#F00;"></span>长</td>
                        <td><input class="validate[option,custom[number],min[0]] text-input" name="combineLength" id="combineLength" value="<?php 
        echo $_smarty_tpl->tpl_vars['combine']->value['combineLength'];
        ?>
"/></td>
                    </tr>
                    <tr>
                        <td><span style="color:#F00;"></span>宽</td>
                        <td><input class="validate[option,custom[number],min[0]] text-input" name="combineWidth" id="combineWidth" value="<?php 
        echo $_smarty_tpl->tpl_vars['combine']->value['combineWidth'];
        ?>
"/></td>
                    </tr>
                    <tr>
                        <td><span style="color:#F00;"></span>高</td>
                        <td><input class="validate[option,custom[number],min[0]] text-input" name="combineHeight" id="combineHeight" value="<?php 
        echo $_smarty_tpl->tpl_vars['combine']->value['combineHeight'];
        ?>
"/></td>
                    </tr>
                    <tr>
                        <td><span style="color:#F00;"></span>备注</td>
                        <td><input name="combineNote" id="combineNote" value="<?php 
        echo $_smarty_tpl->tpl_vars['combine']->value['combineNote'];
        ?>
"/></td>
                    </tr>
                    <tr><td colspan="4"><input type="button" id="addElement2" value="添加真实料号"/></td></tr>
                    <?php 
        $_smarty_tpl->tpl_vars['value'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['value']->_loop = false;
        $_from = OmAvailableModel::getTrueSkuForCombine($_smarty_tpl->tpl_vars['combine']->value['combineSku']);
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['value']->key => $_smarty_tpl->tpl_vars['value']->value) {
            $_smarty_tpl->tpl_vars['value']->_loop = true;
            ?>
                    <tr><td><span style='color:#F00;'>*</span>料号</td><td><input name='sku[]' value="<?php 
            echo $_smarty_tpl->tpl_vars['value']->value['sku'];
            ?>
"/></td> <td width="4%"><span style='color:#F00;'>*</span>数量</td><td><input name='count[]' class="validate[option,custom[integer],min[1]]" value="<?php 
            echo $_smarty_tpl->tpl_vars['value']->value['count'];
            ?>
"/></td></tr>
                    <?php 
        }
        ?>
                </table>
                <div align="center" class="">
                	<input type="submit" value="保存"/>
                    <input type="button" value="返回" id="back"/>
                </div>
            </div>
            </form>
            <div class="bottomvar">
            	<div class="texvar">

            	</div>
            	<div class="pagination">
            	</div>
            </div>
<?php 
        echo $_smarty_tpl->getSubTemplate("footer.htm", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);
    }
开发者ID:ohjack,项目名称:newErp,代码行数:101,代码来源:923a4192da8a6becebf844a9c0137225c3d62047.file.updateCombine.htm.php


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