123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- // +----------------------------------------------------------------------
- // | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
- // +----------------------------------------------------------------------
- // | Copyright (c) 2013-2019 http://www.thinkcmf.com All rights reserved.
- // +----------------------------------------------------------------------
- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
- // +----------------------------------------------------------------------
- // | Author: 老猫 <thinkcmf@126.com>
- // +----------------------------------------------------------------------
- namespace api\activity\model;
- use think\Model;
- use think\model\concern\SoftDelete;
- class ActivityModel extends Model
- {
- use SoftDelete;
- protected $type = ['options' => 'array'];
- public function review()
- {
- return $this->hasOne(ActivityReviewModel::class,'activity_id','id');
- }
- /**
- * 状态名
- */
- static public function statusText($value)
- {
- $time = time();
- if ($value['start_time'] > $time) {
- return '未开始';
- }
- if ($value['start_time'] < $time && $value['end_time'] > $time) {
- return '进行中';
- }
- if ($value['end_time'] < $time) {
- return '已结束';
- }
- }
- }
|