MobileOrderAdmin.php 503 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace app\admin\model;
  3. use think\Model;
  4. /**
  5. * 配置模型
  6. */
  7. class MobileOrderAdmin extends Model
  8. {
  9. public static function add(\app\common\model\MobileOrder $mobileOrder,$when,$admin_id){
  10. if($when){
  11. self::create([
  12. 'mobile_order_id'=>$mobileOrder['id'],
  13. 'admin_id'=>$admin_id,
  14. ]);
  15. }
  16. }
  17. public function admin(){
  18. return $this->belongsTo(Admin::class,'admin_id','id',[])->setEagerlyType(0);
  19. }
  20. }