12345678910111213141516171819202122232425262728 |
- <?php
- namespace app\allwin\model;
- use think\Model;
- class AllwinStoreChain extends Model{
-
- public function store(){
- return $this->hasOne('AllwinStore','id','store_id');
- }
-
- public static function isType(int $id){
- $result = self::where(['id' => $id])->field('types')->find();
- $result->types = $result->types ? 0 : 1;
- return $result->save();
- }
- }
|