1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- namespace app\common\model\store\product;
- use app\common\model\BaseModel;
- use app\common\model\store\order\StoreOrderProduct;
- use app\common\repositories\store\product\ProductAttrValueRepository;
- /**
- * Class ProductReply
- * @package app\common\model\store\product
- * @author zfy
- * @day 2020/5/30
- */
- class ProductReply extends BaseModel
- {
- /**
- * @Author:Qinii
- * @Date: 2020/5/8
- * @return string
- */
- public static function tablePk(): string
- {
- return 'reply_id';
- }
- /**
- * @Author:Qinii
- * @Date: 2020/5/8
- * @return string
- */
- public static function tableName(): string
- {
- return 'store_product_reply';
- }
- public function getPicsAttr($value)
- {
- return $value ? explode(',', $value) : [];
- }
- public function setPicsAttr($value)
- {
- return $value ? implode(',', $value) : '';
- }
- public function product()
- {
- return $this->hasOne(Product::class, 'product_id', 'product_id');
- }
- public function orderProduct()
- {
- return $this->hasOne(StoreOrderProduct::class,'order_product_id','order_product_id');
- }
- }
|