ソースを参照

修改 绘图时 没有对应模型时的错误

ajun 4 年 前
コミット
149e07c8f5
1 ファイル変更1 行追加1 行削除
  1. 1 1
      app/Traits/DrawImage.php

+ 1 - 1
app/Traits/DrawImage.php

@@ -15,8 +15,8 @@ trait DrawImage
 {
 {
     public function draw($orderPackage, $template, $img = null)
     public function draw($orderPackage, $template, $img = null)
     {
     {
-        if (!$template) return null;
         if (!$img) $img = $this->getBgImg($template);
         if (!$img) $img = $this->getBgImg($template);
+        if (!$template) return $img;
 
 
         $items = array_filter($template->value, function ($item) {
         $items = array_filter($template->value, function ($item) {
             return $item['type'] != 'bg';
             return $item['type'] != 'bg';