123456789101112131415161718192021222324252627 |
- <?php
- namespace app\common\model;
- use think\Model;
- use Yansongda\Supports\Str;
- /**
- * 配置模型
- */
- class MobileInfo extends Model
- {
- protected $type=[
- ];
- public function mobile(){
- return $this->belongsTo(Mobile::class);
- }
- protected static function init()
- {
- self::beforeWrite(function (self $info){
- if(isset($info['first_month_free']) && !is_numeric($info['first_month_free'])){
- $info['first_month_free']=Str::contains($info['first_month_free'],'是')?1:0;
- }
- });
- }
- }
|