|
@@ -3,10 +3,14 @@
|
|
|
namespace app\common\model;
|
|
|
|
|
|
use app\common\validate\KillService;
|
|
|
+use think\db\Query;
|
|
|
use think\Model;
|
|
|
|
|
|
/**
|
|
|
* 邮箱验证码
|
|
|
+ * @method $this|static|Query filterNormal()
|
|
|
+ * @method $this|static|Query filterKill()
|
|
|
+ * @method $this|static|Query filterHot()
|
|
|
*/
|
|
|
class Goods Extends Model
|
|
|
{
|
|
@@ -139,6 +143,17 @@ class Goods Extends Model
|
|
|
}
|
|
|
|
|
|
|
|
|
+ public function scopeFilterNormal(Query $query){
|
|
|
+ $query->where('is_kill',0)->where('is_hot',0);
|
|
|
+ }
|
|
|
+ public function scopeFilterKill(Query $query){
|
|
|
+ $query->where('is_kill',1);
|
|
|
+ }
|
|
|
+ public function scopeFilterHot(Query $query){
|
|
|
+ $query->where('is_hot',1);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
public function getDetailUrlAttr($_,$model){
|
|
|
return sprintf('%s/goodsDetail?id=%d',request()->domain(),$model['id']??0);
|
|
|
}
|