<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                ### 導入商品信息生成唯一碼 **位置:** Common\Lib\GoodsLib.class.php **參數:** * @param $style Array 品牌編號和中類的數組 * @return Array 生成系統款號的數組 **調用:** * $GoodsLib = new GoodsLib; * $GoodsLib->getSystemStyleNo($style) ; **完整代碼:** ~~~ /** * 導入商品信息生成系統款號 * whz 2018-05-17 * @param $style array 生成系統款號的商品信息 * @return array 生成系統款號的數組 */ public function getSystemStyleNo($style) { // 生成規則是: 品牌+小類+四位國際款號(或者隨機數) $style_no = $style['style_no']; $index_num = $style['index_num']; $brand_id = $style['brand']; $middle_class = $style['small_class']; $no = substr($style_no, $index_num, 4); // $system_style_no = $m.$brand_id.$y.$middle_class.$no; $system_style_no = $brand_id.$middle_class.$no; // 判斷生成的系統款號是否存在 $res_no = M('goods_spu') ->where(['spu_no' => $system_style_no, 'is_delete' => 0]) ->find(); if (!empty($res_no)) { return ['type' => 1, 'system_style_no' => $res_no['spu_no'], 'num' => $res_no['num'], 'spu_id' => $res_no['id'], 'menu' => $res_no]; } else { // 系統代碼如果在MAP里面存在,并且不和其供應商款號相等,就換另外一個索引值,再插入數據庫,如果不存在直接插入,否則直接返回; $res = M('goods_spu')->where(['spu_no' => $system_style_no, 'is_affirm' => 1])->find(); if (count($res) >0 || !empty($res)) { // 遞歸判斷生成隨機數 $rand = $this->GetfourStr(4); // $system_style_no = $m.$brand_id.$y.$middle_class.$rand; $system_style_no = $brand_id.$middle_class.$rand; $res = M('goods_spu')->where(['spu_no' => $system_style_no])->find(); if (count($res) >0 || !empty($res)) { $arr = getSystemStyleNos($style); return $arr; } else { return ['type' => 2, 'system_style_no' => $system_style_no]; } } return ['type' => 2, 'system_style_no' => $system_style_no]; } } ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看