123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- namespace app\bug\model;
- class Deal extends Base
- {
- protected $schema = [
- 'id' =>'int',
- 'bugNo' =>'varchar',
- 'deal_name' =>'varchar',
- 'deal_id' =>'int',
- 'action_name' =>'varchar',
- 'action_id' =>'int',
- 'level' =>'int',
- 'type' =>'varchar',
- 'status' =>'int',
- 'is_del' =>'int',
- 'addtime' =>'datetime',
- 'updatetime' =>'datetime',
- ];
-
- protected $updateTime='updatetime';
- protected $createTime='addtime';
- public static function onAfterWrite($model){
- $dealLog = new noteLog();
- $origin = $model->getOrigin();
- $add=$model->getChangedData();
- if(empty($add)){
- $dealLog->save([
- 'bugNo' =>$model->bugNo,
- 'type' =>2,
- 'action_uid' =>$model->action_id,
- 'action_name' =>$model->action_name,
- 'handle_name' =>"deal_name",
- 'action_item' =>"",
- 'action_after' =>$origin['deal_name'],
- ]);
- }else{
- if(isset($add['deal_name'])){
- $dealLog->save(
- [
- 'bugNo' =>$model->bugNo,
- 'type' =>2,
- 'action_uid' =>$model->action_id,
- 'action_name' =>$model->action_name,
- 'handle_name' =>'deal_name',
- 'action_item' =>$origin['deal_name'],
- 'action_after' =>$add['deal_name'],
- ]);
- }
- }
- }
- }
|