1234567891011121314151617181920212223242526272829303132 |
- <?php
- // +----------------------------------------------------------------------
- // | A3Mall
- // +----------------------------------------------------------------------
- // | Copyright (c) 2020 http://www.a3-mall.com All rights reserved.
- // +----------------------------------------------------------------------
- // | Author: xzncit <158373108@qq.com>
- // +----------------------------------------------------------------------
- namespace app\admin\model\promotion;
- use app\common\models\goods\Goods;
- use app\common\models\promotion\PromotionPoint as PromotionPointModel;
- class PromotionPoint extends PromotionPointModel {
- /**
- * 增加查询条件
- * @param $query
- * @param $value
- * @param $data
- */
- public function searchTitleAttr($query, $value, $data){
- if(!empty($value)){
- $query->where('promotion_point.title','like','%'.$value.'%');
- }
- }
- public function goods(){
- return $this->hasOne(Goods::class,'id','goods_id')->joinType("LEFT")->bind(["photo"]);
- }
- }
|