123456789101112131415161718192021222324 |
- <?php
- namespace app\common\model;
- use think\db\Query;
- use think\Model;
- /**
- */
- class ViewUnique extends Model
- {
- protected $pk='date';
- public static function add(){
- $date=strtotime(date('Y-m-d 00:00:00'));
- $has=self::where('date',$date)->find();
- if($has){
- $has->setInc('num');
- }else{
- self::create([
- 'date'=>$date,
- 'num'=>1,
- ]);
- }
- }
- }
|