/
home
/
henzagold
/
server
/
app
/
Models
/
File Upload :
llllll
Current File: /home/henzagold/server/app/Models/Comment.php
<?php namespace App\Models; use App\DB\Selector; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; class Comment extends Model { use HasFactory; use SoftDeletes; use Selector; protected $fillable=[ 'product_id', 'comment', 'reply_to', 'sts', 'customer_id', ]; public static $STS = [ 1 => 'در انتظار تایید', 2 => 'تایید شده', 3 => 'رد شده', ]; public function Reply(){ return $this->hasMany(Comment::class,'reply_to')->select(['*',Comment::$SELECT_CAJ]); } public function customer(){ //$customer = new SingleCustomer(); //array_diff($customer->fillable,['token_sms']) return $this->hasOne(SingleCustomer::class,'id','customer_id')->select(['id','lname','fname']); } public function product(){ return $this->hasOne(Product::class,'id','product_id'); } }
Copyright ©2k19 -
Hexid
|
Tex7ure