1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- namespace app\ais\model;
- use think\Model;
- use app\common\facade\Inform;
- use app\ais\model\AisStore;
- class AisStoreWorker extends Model{
-
-
- public function user(){
- return $this->hasOne('app\common\model\SystemUser','id','uid');
- }
-
- public function store(){
- return $this->hasOne('AisStore','id','store_id');
- }
-
-
- public static function setWorker(int $id){
- $result = self::where(['id' => $id])->field('is_cashier,uid')->find();
- $result->is_cashier = $result->is_cashier ? 0 : 1;
- return $result->save();
- }
- }
|