123456789101112131415161718192021222324252627282930313233 |
- <?php
- namespace App\Modules\OfficialAccount\Models;
- use Illuminate\Database\Eloquent\Model;
- class OfficialCustomMsg extends Model
- {
- protected $table = 'official_custom_msg';
- protected $fillable = ['title','description','url','image','text','channelname'];
- /**
- * 根据text获取客服消息
- */
- static function officialCustomMsgByText($text)
- {
-
- return self::where('text',$text)->first();
-
- }
- /**
- * 根据channelname和text获取神书
- */
- static function customerMsgByChannelAndText($channelname,$text)
- {
- return self::where(['channelname'=>$channelname,'text'=>$text])->get();
- }
- }
|