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
36 lines
809 B
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Dcat\Admin\Traits\HasDateTimeFormatter;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class LanzuStore extends Model
|
|
{
|
|
use HasDateTimeFormatter;
|
|
protected $table = 'lanzu_store';
|
|
protected $dateFormat = 'U';
|
|
|
|
public $timestamps = false;
|
|
|
|
public function market(){
|
|
return $this->hasOne('\App\Models\ImsCjdcMarket','id','market_id');
|
|
}
|
|
|
|
public function storeAccount(){
|
|
return $this->hasMany(StoreAccount::class,'store_id','id');
|
|
}
|
|
|
|
public static function getData($marketId=null)
|
|
{
|
|
if ($marketId){
|
|
$result = self::where('market_id',$marketId)
|
|
->pluck('name','id')->toArray();
|
|
|
|
}else{
|
|
$result = self::pluck('name','id')->toArray();
|
|
}
|
|
return $result;
|
|
}
|
|
}
|