Soft delete and verification code conflict
凡人
凡人 2019-08-11 08:54:14
0
1
1201

protected $pk = 'id';//You need to specify the primary index
protected $table = 'user';
protected $autoWriteTimestamp=true;//Automatic timestamp
protected $createTime=' create_time';
protected $updateTime='update_time';
protected $dateFormat='Y year m month d day';//Used to set the format for timestamp display
//Import soft delete method set
use SoftDelete;
//Set the soft delete field
//This field will be displayed only if it is NULL
protected $deleteTime = 'delete_time';//This field must be the same as the data The fields in the table are consistent


// Save the autocomplete list
protected $auto = [
'delete_time' => NULL,
'is_delete' => 1, //1: Allow deletion 0: Prohibit deletion
];
// Add automatic completion list
protected $insert = [
'login_time'=> NULL, //Log in when adding The time should be NULL, because it was just created
'login_count' => 0, //The reason is the same as above, there must be no login when it is just created
];

Write verification like this The code is never correct. Just delete the soft deleted part and there will be no problem. I am using 5.1TP. . . do not know why

凡人
凡人

reply all(1)
Peter-Zhu

The course is based on version 5.0. You are on 5.1. Check out the soft deletion section in the 5.1 manual

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template