123456789101112131415161718192021222324 |
- <?php
- use app\model\Grant;
- use app\model\Permission;
- use think\migration\Migrator;
- use think\migration\db\Column;
- use app\model\AgentType;
- class SaveDefaultAgentName extends Migrator
- {
- public function change()
- {
- $addmod = new AgentType;
- $list= AgentType::where([['type_name','=','经纪人']])->field('id,type_name')->select()->toArray();
- foreach($list as $key=>$val){
- $all[] = ['type_name'=>'推荐官','id'=>$val['id']];
- }
- $addmod->saveAll($all);
- }
- }
|