123456789101112131415161718192021222324252627282930 |
- <?php
- namespace app\admin\model;
- use think\Model;
- class ChangeLog extends Model
- {
- //记录商品、咨询单的修改记录
- static function logAdd($type,$code,$before_info,$after_info,$token){
- if (is_array($token)) {
- $createrid = $token['id'];
- $creater = $token['nickname'];
- } else {
- $user = GetUserInfo($token);
- $createrid = isset($user['data']['id']) ? $user['data']['id'] : 0;
- $creater = isset($user['data']['nickname']) ? $user['data']['nickname'] : '';
- }
- $data=[
- "createrid"=>$createrid,
- "creater"=>$creater,
- "before_info"=>$before_info,
- "after_info"=>$after_info,
- "code"=>$code,
- "type"=>$type,
- "addtime"=>date("Y-m-d H:i:s"),
- ];
- self::insert($data);
- }
- }
|