xieruidong 2 лет назад
Родитель
Сommit
146d7d7043

+ 12 - 1
app/data/model/ShopProductionItem.php

@@ -7,9 +7,20 @@ use think\admin\Model;
 class ShopProductionItem extends Model
 {
     protected $type=[
-        'enclosure'=>'array',
+        //'enclosure'=>'array',
     ];
     public function offers(){
         return $this->hasMany(ShopProductionOffer::class,'item_id');
     }
+
+    public function getEnclosureAttr($file){
+        $files=json_decode($file,true);
+        foreach ($files as &$file){
+            $file['icon']=sprintf('%s/static/images/ext/pdf.png',request()->domain());
+        }
+        return $files;
+    }
+    public function setEnclosureAttr($file){
+        return json_encode($file?:[],256);
+    }
 }

+ 14 - 0
app/data/model/ShopPurchaseMsg.php

@@ -0,0 +1,14 @@
+<?php
+
+namespace app\data\model;
+
+use app\data\model\helpers\PurchaseShow;
+use think\admin\Model;
+use think\db\Query;
+use think\facade\Db;
+use think\helper\Arr;
+
+class ShopPurchaseMsg extends Model
+{
+
+}

BIN
public/static/images/ext/pdf.png