feat: sku
This commit is contained in:
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
use App\Constants\Common\GoodCode;
|
||||
use Hyperf\Database\Model\Builder;
|
||||
use Hyperf\DbConnection\Model\Model;
|
||||
|
||||
@@ -16,7 +17,8 @@ use Hyperf\DbConnection\Model\Model;
|
||||
* @property string $title
|
||||
* @property string $sub_title
|
||||
* @property int $category_id
|
||||
* @property int $saleable
|
||||
* @property int $saleable
|
||||
* @property int $is_del
|
||||
* @property string $create_time
|
||||
* @property string $update_time
|
||||
*/
|
||||
@@ -45,11 +47,12 @@ class Spu extends Model
|
||||
/**
|
||||
* @param int $cityId
|
||||
* @param int $cycleId
|
||||
* @param string $title
|
||||
* @return Builder|\Hyperf\Database\Model\Model|null
|
||||
*/
|
||||
public function getInfoByCityIdAndCycleId(int $cityId, int $cycleId): \Hyperf\Database\Model\Model|Builder|null
|
||||
public function getInfoByCityIdAndCycleId(int $cityId, int $cycleId,string $title): \Hyperf\Database\Model\Model|Builder|null
|
||||
{
|
||||
return $this->where('city_id', $cityId)->where('cycle_id', $cycleId)->first();
|
||||
return $this->where('city_id', $cityId)->where('cycle_id', $cycleId)->where('title',$title)->where('is_del',GoodCode::SPU_IS_NO_DEL)->first();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -58,6 +61,6 @@ class Spu extends Model
|
||||
*/
|
||||
public function getInfoById(int $id): \Hyperf\Database\Model\Model|Builder|null
|
||||
{
|
||||
return $this->where('id', $id)->first();
|
||||
return $this->where('id', $id)->where('is_del',GoodCode::SPU_IS_NO_DEL)->first();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user