| 12345678910111213141516171819202122232425 |
- <?php
- namespace App\Model;
- use Illuminate\Database\Eloquent\Model;
- /**
- *
- * Class Unit
- * @package App\Models
- */
- class Box extends Model
- {
- protected $table = "box"; //指定表
- const CREATED_AT = 'crt_time';
- const UPDATED_AT = 'upd_time';
- protected $dateFormat = 'U';
- public function setConnection($name)
- {
- $mysql = "mysql";
- if($name === '001') $mysql = "mysql_001";
- if($name === '002') $mysql = "mysql_002";
- return parent::setConnection($mysql); // TODO: Change the autogenerated stub
- }
- }
|