芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/store.kwesioben.com/app/Model/Seller.php
'integer', 'orders_count' => 'integer', 'product_count' => 'integer', 'pos+status' => 'integer' ]; public function scopeApproved($query) { return $query->where(['status'=>'approved']); } public function shop() { return $this->hasOne(Shop::class, 'seller_id'); } public function shops() { return $this->hasMany(Shop::class, 'seller_id'); } public function orders() { return $this->hasMany(Order::class, 'seller_id'); } public function product() { return $this->hasMany(Product::class, 'user_id')->where(['added_by'=>'seller']); } public function wallet() { return $this->hasOne(SellerWallet::class); } public function coupon(){ return $this->hasMany(Coupon::class, 'seller_id') ->where(['coupon_bearer'=>'seller', 'status'=>1]) ->whereDate('start_date','<=',date('Y-m-d')) ->whereDate('expire_date','>=',date('Y-m-d')); } }