chuweiqiang 1 year ago
parent
commit
edd611f6c5

+ 14 - 5
.idea/workspace.xml

@@ -3,11 +3,20 @@
   <component name="ChangeListManager">
     <list default="true" id="1a36929e-c054-4875-a943-593a74e55fa4" name="Default Changelist" comment="">
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/application/api/controller/Datum.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Datum.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/nutrition/controller/ArticleItem.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/controller/ArticleItem.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/nutrition/controller/SeriesDatum.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/controller/SeriesDatum.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/nutrition/controller/VideoUrl.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/controller/VideoUrl.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/nutrition/view/article_item/form.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/view/article_item/form.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/nutrition/view/series_datum/form.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/view/series_datum/form.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/nutrition/view/video_url/form.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/view/video_url/form.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/operate/controller/Press.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/controller/Press.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/operate/view/press/form.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/view/press/form.html" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/runtime/cache/4c/d9aaff68a897261d9d4e25ac10435f.php" beforeDir="false" afterPath="$PROJECT_DIR$/runtime/cache/4c/d9aaff68a897261d9d4e25ac10435f.php" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/runtime/log/single.log" beforeDir="false" afterPath="$PROJECT_DIR$/runtime/log/single.log" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/runtime/log/single_error.log" beforeDir="false" afterPath="$PROJECT_DIR$/runtime/log/single_error.log" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/runtime/log/single_sql.log" beforeDir="false" afterPath="$PROJECT_DIR$/runtime/log/single_sql.log" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/runtime/temp/3a2fc529b781103baceb9d9b660602e9.php" beforeDir="false" afterPath="$PROJECT_DIR$/runtime/temp/3a2fc529b781103baceb9d9b660602e9.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/runtime/temp/9462ddc27b654c9118a3a61ae55e92df.php" beforeDir="false" afterPath="$PROJECT_DIR$/runtime/temp/9462ddc27b654c9118a3a61ae55e92df.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/runtime/temp/fd196fc52d16d9eb4ade21e166aebae4.php" beforeDir="false" afterPath="$PROJECT_DIR$/runtime/temp/fd196fc52d16d9eb4ade21e166aebae4.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -575,7 +584,7 @@
       <workItem from="1710817453185" duration="16334000" />
       <workItem from="1710896140284" duration="18662000" />
       <workItem from="1710981036861" duration="23494000" />
-      <workItem from="1711067530545" duration="2530000" />
+      <workItem from="1711067530545" duration="8253000" />
     </task>
     <servers />
   </component>
@@ -697,10 +706,10 @@
     </option>
   </component>
   <component name="WindowStateProjectService">
-    <state x="948" y="400" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog" timestamp="1711004484314">
+    <state x="948" y="400" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog" timestamp="1711076989904">
       <screen x="0" y="0" width="2194" height="1194" />
     </state>
-    <state x="948" y="400" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog/0.0.2194.1194@0.0.2194.1194" timestamp="1711004484314" />
+    <state x="948" y="400" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog/0.0.2194.1194@0.0.2194.1194" timestamp="1711076989904" />
     <state x="1215" y="438" key="FileChooserDialogImpl" timestamp="1709186289530">
       <screen x="0" y="0" width="2194" height="1194" />
     </state>

+ 6 - 0
application/nutrition/controller/ArticleItem.php

@@ -3,6 +3,7 @@ namespace app\Nutrition\controller;
 use app\common\model\ArticleIntro;
 use app\common\model\DatumIntro;
 use app\common\model\PlatformSwitch;
+use app\common\model\Supplier;
 use app\common\model\SupplierGoods;
 use app\common\model\User;
 use library\Controller;
@@ -157,6 +158,11 @@ class ArticleItem extends Controller
                 ->where('status',1)
                 ->order('id desc')
                 ->select()->toArray();
+
+            $this->supplier = Supplier::with('goodsList')
+                ->where(['is_deleted'=>0])
+                ->where('status',1)
+                ->select()->toArray();
             $this->supplier_goods = SupplierGoods::getSupplierGoodsList($this->request->action() == 'add' ? ['s.is_deleted'=>0]: []);
         }
         if($this->request->isPost()){

+ 5 - 0
application/nutrition/controller/SeriesDatum.php

@@ -4,6 +4,7 @@ use app\common\model\datum_idIntro;
 use app\common\model\datum_idUrl;
 use app\common\model\DatumIntro;
 use app\common\model\DatumUrl;
+use app\common\model\Supplier;
 use app\common\model\SupplierGoods;
 use library\Controller;
 use library\tools\Data;
@@ -180,6 +181,10 @@ class SeriesDatum extends Controller
             $this->video_list = \app\common\model\VideoIntro::with('videoArr')
                 ->where(['is_deleted'=>0])->where('status',1)->order('id desc')
                 ->select()->toArray();
+            $this->supplier = Supplier::with('goodsList')
+                ->where(['is_deleted'=>0])
+                ->where('status',1)
+                ->select()->toArray();
             $this->supplier_goods = SupplierGoods::getSupplierGoodsList($this->request->action() == 'add' ? ['s.is_deleted'=>0,'g.status' => 1,'g.is_deleted' => 0]: ['g.status' => 1,'g.is_deleted' => 0]);
 
         }

+ 5 - 0
application/nutrition/controller/VideoUrl.php

@@ -3,6 +3,7 @@ namespace app\Nutrition\controller;
 use app\api\controller\Video;
 use app\common\model\DatumIntro;
 use app\common\model\PlatformSwitch;
+use app\common\model\Supplier;
 use app\common\model\SupplierGoods;
 use app\common\model\User;
 use app\common\model\VideoIntro;
@@ -161,6 +162,10 @@ class VideoUrl extends Controller
                 ->where(['is_deleted'=>0])->order('id desc')
                 ->where('status',1)
                 ->select()->toArray();
+            $this->supplier = Supplier::with('goodsList')
+                ->where(['is_deleted'=>0])
+                ->where('status',1)
+                ->select()->toArray();
             $this->supplier_goods = SupplierGoods::getSupplierGoodsList($this->request->action() == 'add' ? ['s.is_deleted'=>0]: []);
         }
         if($this->request->isPost()){

+ 33 - 3
application/nutrition/view/article_item/form.html

@@ -93,11 +93,23 @@
 
             <div class="layui-form-item" >
                 <label class="layui-form-label ">关联商品</label>
-                <div class="layui-input-inline"  style="width: 300px">
+                <div class="layui-input-inline"  >
+                    <select name="supplier_id" lay-filter ="supplier_id" lay-search>
+                        <option value="0">请选择</option>
+                        {foreach $supplier as $dk=>$dv}
+                        <option  {if isset($vo.supplier_id) && $vo.supplier_id == $dv['id'] }selected{/if} data-dl_key="{$dk}" value="{$dv['id']}">{$dv['title']}</option>
+                        {/foreach}
+                    </select>
+                </div>
+                <div class="layui-input-inline">
                     <select name="goods_id" lay-filter ="goods_id" lay-search>
                         <option value="0">请选择</option>
-                        {foreach $supplier_goods as $gk=>$gv}
-                        <option  {if isset($vo.goods_id) && $vo.goods_id == $gv['id'] }selected{/if}  value="{$gv['id']}">{$gv['name']}------{$gv['title']}</option>
+                        {foreach $supplier as $vk=>$vv}
+                        {if isset($vo.supplier_id) && $vo.supplier_id == $vv['id'] }
+                        {foreach $vv['goods_list'] as $cln}
+                        <option {if isset($vo.goods_id) && $vo.goods_id == $cln['id']} selected  {/if} value="{$cln['id']}">{$cln['name']}</option>
+                        {/foreach}
+                        {/if}
                         {/foreach}
                     </select>
                 </div>
@@ -275,6 +287,7 @@
             $("select[name='datum_item']").html(cl_html);
         }else{
             var dl_key =  data.elem[data.elem.selectedIndex].dataset.dl_key;
+            console.log(dl_key);
             var datum_list = {:json_encode($datum_list)};
             $.each(datum_list[dl_key]['url_arr'],function (ck,cv) {
                 cl_html +='<option value="'+cv.id+'">'+cv.title+'</option>';
@@ -284,6 +297,23 @@
         window.form.render();
     });
 
+    // 关联供应商商品监听
+    form.on('select(supplier_id)', function(data){
+        var cl_html = '<option value="0">请选择</option>';
+        if(data.value == 0) {
+            $("select[name='goods_id']").html(cl_html);
+        }else{
+            var dl_key =  data.elem[data.elem.selectedIndex].dataset.dl_key;
+            console.log(dl_key);
+            var supplier = {:json_encode($supplier)};
+            $.each(supplier[dl_key]['goods_list'],function (ck,cv) {
+                cl_html +='<option value="'+cv.id+'">'+cv.name+'</option>';
+            })
+            $("select[name='goods_id']").html(cl_html);
+        }
+        window.form.render();
+    });
+
 
     form.on('select(content_type)', function(data){
         check_type()

+ 35 - 5
application/nutrition/view/series_datum/form.html

@@ -60,12 +60,24 @@
             </div>
 
             <div class="layui-form-item" >
-                <label class="layui-form-label ">关联品</label>
-                <div class="layui-input-inline"  style="width: 300px">
-                    <select name="goods_id" lay-filter ="goods_id" lay-search="">
+                <label class="layui-form-label ">关联品</label>
+                <div class="layui-input-inline"  >
+                    <select name="supplier_id" lay-filter ="supplier_id" lay-search>
                         <option value="0">请选择</option>
-                        {foreach $supplier_goods as $gk=>$gv}
-                        <option  {if isset($vo.goods_id) && $vo.goods_id == $gv['id'] }selected{/if}  value="{$gv['id']}">{$gv['name']}------{$gv['title']}</option>
+                        {foreach $supplier as $dk=>$dv}
+                        <option  {if isset($vo.supplier_id) && $vo.supplier_id == $dv['id'] }selected{/if} data-dl_key="{$dk}" value="{$dv['id']}">{$dv['title']}</option>
+                        {/foreach}
+                    </select>
+                </div>
+                <div class="layui-input-inline">
+                    <select name="goods_id" lay-filter ="goods_id" lay-search>
+                        <option value="0">请选择</option>
+                        {foreach $supplier as $vk=>$vv}
+                        {if isset($vo.supplier_id) && $vo.supplier_id == $vv['id'] }
+                        {foreach $vv['goods_list'] as $cln}
+                        <option {if isset($vo.goods_id) && $vo.goods_id == $cln['id']} selected  {/if} value="{$cln['id']}">{$cln['name']}</option>
+                        {/foreach}
+                        {/if}
                         {/foreach}
                     </select>
                 </div>
@@ -125,5 +137,23 @@
             }
             window.form.render();
         });
+
+        // 关联供应商商品监听
+        form.on('select(supplier_id)', function(data){
+            var cl_html = '<option value="0">请选择</option>';
+            if(data.value == 0) {
+                $("select[name='goods_id']").html(cl_html);
+            }else{
+                var dl_key =  data.elem[data.elem.selectedIndex].dataset.dl_key;
+                console.log(dl_key);
+                var supplier = {:json_encode($supplier)};
+                $.each(supplier[dl_key]['goods_list'],function (ck,cv) {
+                    cl_html +='<option value="'+cv.id+'">'+cv.name+'</option>';
+                })
+                $("select[name='goods_id']").html(cl_html);
+            }
+            window.form.render();
+        });
+
     </script>
 </div>

+ 32 - 4
application/nutrition/view/video_url/form.html

@@ -92,12 +92,24 @@
             </div>
 
             <div class="layui-form-item" >
-                <label class="layui-form-label ">关联产品</label>
-                <div class="layui-input-inline"  style="width: 300px">
+                <label class="layui-form-label ">关联商品</label>
+                <div class="layui-input-inline"  >
+                    <select name="supplier_id" lay-filter ="supplier_id" lay-search>
+                        <option value="0">请选择</option>
+                        {foreach $supplier as $dk=>$dv}
+                        <option  {if isset($vo.supplier_id) && $vo.supplier_id == $dv['id'] }selected{/if} data-dl_key="{$dk}" value="{$dv['id']}">{$dv['title']}</option>
+                        {/foreach}
+                    </select>
+                </div>
+                <div class="layui-input-inline">
                     <select name="goods_id" lay-filter ="goods_id" lay-search>
                         <option value="0">请选择</option>
-                        {foreach $supplier_goods as $gk=>$gv}
-                        <option  {if isset($vo.goods_id) && $vo.goods_id == $gv['id'] }selected{/if}  value="{$gv['id']}">{$gv['name']}------{$gv['title']}</option>
+                        {foreach $supplier as $vk=>$vv}
+                        {if isset($vo.supplier_id) && $vo.supplier_id == $vv['id'] }
+                        {foreach $vv['goods_list'] as $cln}
+                        <option {if isset($vo.goods_id) && $vo.goods_id == $cln['id']} selected  {/if} value="{$cln['id']}">{$cln['name']}</option>
+                        {/foreach}
+                        {/if}
                         {/foreach}
                     </select>
                 </div>
@@ -286,6 +298,22 @@
             window.form.render();
         })
 
+        // 关联供应商商品监听
+        form.on('select(supplier_id)', function(data){
+            var cl_html = '<option value="0">请选择</option>';
+            if(data.value == 0) {
+                $("select[name='goods_id']").html(cl_html);
+            }else{
+                var dl_key =  data.elem[data.elem.selectedIndex].dataset.dl_key;
+                console.log(dl_key);
+                var supplier = {:json_encode($supplier)};
+                $.each(supplier[dl_key]['goods_list'],function (ck,cv) {
+                    cl_html +='<option value="'+cv.id+'">'+cv.name+'</option>';
+                })
+                $("select[name='goods_id']").html(cl_html);
+            }
+            window.form.render();
+        });
 
         function check_type() {
             if( $("select[name='up_type']").val() == 1) {

+ 5 - 0
application/operate/controller/Press.php

@@ -1,6 +1,7 @@
 <?php
 namespace app\operate\controller;
 use app\common\model\DatumIntro;
+use app\common\model\Supplier;
 use app\common\model\SupplierGoods;
 use app\common\model\User;
 use library\Controller;
@@ -150,6 +151,10 @@ class Press extends Controller
         $this->datum_list  = DatumIntro::with('urlArr')
             ->where(['is_deleted'=>0])->order('id desc')
             ->select()->toArray();
+        $this->supplier = Supplier::with('goodsList')
+            ->where(['is_deleted'=>0])
+            ->where('status',1)
+            ->select()->toArray();
         $this->supplier_goods = SupplierGoods::getSupplierGoodsList($this->request->action() == 'add' ? ['s.is_deleted'=>0,'g.is_deleted'=>0]: ['s.is_deleted'=>0,'g.is_deleted'=>0]);
         if($this->request->isPost())
         {

+ 38 - 13
application/operate/view/press/form.html

@@ -170,19 +170,27 @@
                         </div>
                     </div>
 
-                    <div class="layui-form-item layui-row layui-col-space15">
-                        <label class="layui-col-xs12 relative">
-                            <span class="color-green">产品</span>
-                        </label>
-                        <div class="layui-inline" style="top: -15px;margin-bottom: -25px;margin-right: 20px;">
-                            <div class="layui-input-inline">
-                                <select name="goods_id" lay-filter ="goods_id" lay-search>
-                                    <option value="0">请选择</option>
-                                    {foreach $supplier_goods as $gk=>$gv}
-                                    <option  {if isset($vo.goods_id) && $vo.goods_id == $gv['id'] }selected{/if}  value="{$gv['id']}">{$gv['name']}------{$gv['title']}</option>
-                                    {/foreach}
-                                </select>
-                            </div>
+                    <div class="layui-form-item" >
+                        <label class="layui-form-label ">关联商品</label>
+                        <div class="layui-input-inline"  >
+                            <select name="supplier_id" lay-filter ="supplier_id" lay-search>
+                                <option value="0">请选择</option>
+                                {foreach $supplier as $dk=>$dv}
+                                <option  {if isset($vo.supplier_id) && $vo.supplier_id == $dv['id'] }selected{/if} data-dl_key="{$dk}" value="{$dv['id']}">{$dv['title']}</option>
+                                {/foreach}
+                            </select>
+                        </div>
+                        <div class="layui-input-inline">
+                            <select name="goods_id" lay-filter ="goods_id" lay-search>
+                                <option value="0">请选择</option>
+                                {foreach $supplier as $vk=>$vv}
+                                {if isset($vo.supplier_id) && $vo.supplier_id == $vv['id'] }
+                                {foreach $vv['goods_list'] as $cln}
+                                <option {if isset($vo.goods_id) && $vo.goods_id == $cln['id']} selected  {/if} value="{$cln['id']}">{$cln['name']}</option>
+                                {/foreach}
+                                {/if}
+                                {/foreach}
+                            </select>
                         </div>
                     </div>
 
@@ -266,5 +274,22 @@
         }
         window.form.render();
     });
+
+    // 关联供应商商品监听
+    form.on('select(supplier_id)', function(data){
+        var cl_html = '<option value="0">请选择</option>';
+        if(data.value == 0) {
+            $("select[name='goods_id']").html(cl_html);
+        }else{
+            var dl_key =  data.elem[data.elem.selectedIndex].dataset.dl_key;
+            console.log(dl_key);
+            var supplier = {:json_encode($supplier)};
+            $.each(supplier[dl_key]['goods_list'],function (ck,cv) {
+                cl_html +='<option value="'+cv.id+'">'+cv.name+'</option>';
+            })
+            $("select[name='goods_id']").html(cl_html);
+        }
+        window.form.render();
+    });
 </script>
 {/block}

File diff suppressed because it is too large
+ 0 - 0
runtime/cache/4c/d9aaff68a897261d9d4e25ac10435f.php


File diff suppressed because it is too large
+ 4913 - 0
runtime/log/single.log


File diff suppressed because it is too large
+ 1558 - 0
runtime/log/single_sql.log


File diff suppressed because it is too large
+ 0 - 1
runtime/temp/3a2fc529b781103baceb9d9b660602e9.php


File diff suppressed because it is too large
+ 8 - 0
runtime/temp/4194b39c8dced258688386f8eb16f583.php


File diff suppressed because it is too large
+ 0 - 1
runtime/temp/9462ddc27b654c9118a3a61ae55e92df.php


File diff suppressed because it is too large
+ 0 - 1
runtime/temp/fd196fc52d16d9eb4ade21e166aebae4.php


Some files were not shown because too many files changed in this diff