| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- namespace app\common\model\product;
- use app\common\model\BaseModel;
- /**
- * 商品上下架定时器模型
- */
- class ProductTimer extends BaseModel
- {
- protected $name = 'product_timer';
- protected $pk = 'id';
- /**
- * 查询
- */
- public static function detail($productId)
- {
- return (new static())->where('product_id', '=', $productId)->find();
- }
- /**
- * 删除
- * @param $productId
- * @return bool
- */
- public static function deleteTimer($productId): bool
- {
- return (new static())->where('product_id', '=', $productId)->delete();
- }
- /**
- * 删除
- * @param $taskId
- * @return bool
- */
- public static function deleteTimerByTaskId($taskId): bool
- {
- return (new static())->where('task_id', '=', $taskId)->delete();
- }
- }
|