| 123456789101112131415161718192021222324252627282930 |
- <?php
- namespace app\common\model;
- class ActivityProductModel extends BaseModel
- {
- protected $table = 'erp_activity_product';
- protected function genSchema(array $schema)
- {
- // TODO: Implement genSchema() method.
- }
- public function product() {
- return $this->hasOne(ProductModel::class,'id','product_id');
- }
- public function doesItExist($product_id) {
- return $this->where([
- ["product_id", '=', $product_id],
- ["is_delete", '=', 0]
- ])->find();
- }
- }
|