链街Dcat后台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
809 B

  1. <?php
  2. namespace App\Models;
  3. use Dcat\Admin\Traits\HasDateTimeFormatter;
  4. use Illuminate\Database\Eloquent\Model;
  5. class LanzuStore extends Model
  6. {
  7. use HasDateTimeFormatter;
  8. protected $table = 'lanzu_store';
  9. protected $dateFormat = 'U';
  10. public $timestamps = false;
  11. public function market(){
  12. return $this->hasOne('\App\Models\ImsCjdcMarket','id','market_id');
  13. }
  14. public function storeAccount(){
  15. return $this->hasMany(StoreAccount::class,'store_id','id');
  16. }
  17. public static function getData($marketId=null)
  18. {
  19. if ($marketId){
  20. $result = self::where('market_id',$marketId)
  21. ->pluck('name','id')->toArray();
  22. }else{
  23. $result = self::pluck('name','id')->toArray();
  24. }
  25. return $result;
  26. }
  27. }