chuweiqiang 1 năm trước cách đây
mục cha
commit
bd26a41208

+ 14 - 1
app/admin/controller/Recruitment.php

@@ -65,7 +65,20 @@ class Recruitment extends Controller
     }
     protected function _index_page_filter(&$data)
     {
-       // dump($data);die;
+
+        if(AdminService::getUserId()==10000){
+            $admin_id = [];
+            foreach ($data as $k =>  $v){
+                $data[$k]['is_display'] = $v['uid'];
+            }
+        }else{
+            foreach ($data as $k => $v){
+                $data[$k]['is_display'] = 0;
+            }
+//            $admin_id['uid']=AdminService::getUserId();
+        }
+//        dump($data);die;
+
     }
 
     /**

+ 1 - 1
app/admin/view/recruitment/index.html

@@ -68,7 +68,7 @@
     <button class="layui-btn layui-btn-sm" data-title="查看" data-modal='{:url("audit")}?id={{d.id}}'>查看</button>
     <button class="layui-btn layui-btn-sm" data-title="编辑" data-open="{:url("edit")}?id={{d.id}}" style="{{-d.uid ?'display: none':''}}"  >编辑</button>
 <!--    <button class="layui-btn layui-btn-danger layui-btn-sm" data-title="删除" data-open="{:url("edit")}?id={{d.id}}" style="{{-d.uid ?'display: none':''}}"  >删除</button>-->
-    <a class="layui-btn layui-btn-danger layui-btn-sm" data-action="{:url('remove')}" data-value="id#{{d.id}}" style="{{-d.uid ?'display: none':''}}" data-confirm="确定要删除吗?">删 除</a>
+    <a class="layui-btn layui-btn-danger layui-btn-sm" data-action="{:url('remove')}" data-value="id#{{d.id}}" style="{{-d.is_display ?'display: none':''}}" data-confirm="确定要删除吗?">删 除</a>
     <button class="layui-btn layui-btn-sm" data-title="感兴趣列表" data-width="1100px" data-modal='{:url("collection")}?link_id={{d.id}}'>感兴趣列表</button>
     {/if}
 <!--    <input type="checkbox" value="{{d.id}}" lay-skin="switch" lay-text="已激活|已禁用" lay-filter="StatusSwitch" {{-d.uid=0?'checked':''}}>-->

+ 17 - 0
app/data/model/DataXw.php

@@ -23,6 +23,23 @@ class DataXw extends Model
     public static function onBeforeWrite(self $model)
     {
 //        return true;
+//        $dom = new \DOMDocument();
+//        $dom->loadHTML($model['content']);
+
+// 获取所有的 h1 标签
+//        $h1Tags = $dom->getElementsByTagName('video');
+        preg_match_all('/<video[^>]*>(.*?)<\/video>/s', $model['content'], $matches);
+//        var_dump($matches);die;
+        foreach ($matches as $k => $v){
+            echo htmlspecialchars($v[1]);die;
+        }
+
+        if (isset($matches[1])) {
+            echo "视频标签内容为:" . htmlspecialchars($matches[1]);
+        } else {
+            echo "未找到视频标签";
+        }
+
         $model['has_video']=Str::contains($model['content'],'</video>');
         if($model['has_video']){
             $html=HtmlDomParser::str_get_html($model['content']);