increments('id'); $table->integer('uniacid')->comment('公众号'); $table->boolean('status')->default(0)->comment('0关闭1开启'); $table->longText('content')->nullable()->comment('内容'); $table->integer('created_at')->nullable(); $table->integer('updated_at')->nullable(); }); \Illuminate\Support\Facades\DB::statement("ALTER TABLE " . app('db')->getTablePrefix() . "yz_protocol comment '会员--会员注册协议表'");//表注释 } $member_protocol = \app\common\models\Setting::where(['key' => 'protocol', 'group' => 'shop'])->select('uniacid', 'value')->get()->toArray(); foreach ($member_protocol as $k => $value){ $data[$k]['status'] = unserialize($value['value'])['protocol'] ?: 0; $data[$k]['content'] = unserialize($value['value'])['content'] ?: ''; $data[$k]['uniacid'] = $value['uniacid']; $data[$k]['created_at'] = time(); $data[$k]['updated_at'] = time(); } if(!empty($data)){ \Illuminate\Support\Facades\DB::table('yz_protocol')->insert($data); } } /** * Reverse the migrations. * * @return void */ public function down() { // } }