diff --git a/app/wechat/model/WechatMedia.php b/app/wechat/model/WechatMedia.php new file mode 100644 index 000000000..4119e5b3b --- /dev/null +++ b/app/wechat/model/WechatMedia.php @@ -0,0 +1,28 @@ + md5($url), 'appid' => WechatService::instance()->getAppid()]; - if (($mediaId = $this->app->db->name('WechatMedia')->where($map)->value('media_id'))) return $mediaId; + if (($mediaId = WechatMedia::mk()->where($map)->value('media_id'))) return $mediaId; $result = WechatService::WeChatMedia()->addMaterial(self::buildCurlFile($url), $type, $video); - data_save('WechatMedia', [ + data_save(WechatMedia::class, [ 'local_url' => $url, 'md5' => $map['md5'], 'type' => $type, 'appid' => $map['appid'], 'media_url' => $result['url'] ?? '', 'media_id' => $result['media_id'], ], 'type', $map);