songxingwei 3 lat temu
rodzic
commit
5be8c9beac

+ 2 - 2
application/store/controller/Article.php

@@ -131,10 +131,10 @@ class Article extends Controller
         if ($this->request->isGet()) {
             if (!empty($data)){
                 $catelist = Db::name('cate')->where('type',$data['type'])->where('is_del',1)->where('status',1)->select();
-                dump($catelist);
             }else{
                 $catelist = Db::name('cate')->where('type',1)->where('is_del',1)->where('status',1)->select();
-                dump($catelist);
+                $ids = $catelist[0]['id'];
+                $this->ids = $ids;
             }
             $this->catelist = $catelist;
         }else{

+ 1 - 1
application/store/view/article/form.html

@@ -57,7 +57,7 @@
                 <div id="cate" lay-filter="cate">
                     {if !isset($vo.id)}
                        {foreach $catelist as $key=>$v}
-                         <input type="radio" name="cate" value="{$v.id}" title="{$v.name}">
+                         <input type="radio" name="cate" {if $v.id eq $ids}checked{/if} value="{$v.id}" title="{$v.name}">
                        {/foreach}
 
                     {else}