CommodityModel.php 476 B

1234567891011121314151617181920
  1. <?php
  2. namespace app\api\model;
  3. use think\Model;
  4. class CommodityModel extends Model
  5. {
  6. protected $name = "commodity";
  7. protected $resultSetType = 'collection';
  8. public function parameter () {
  9. return $this->hasMany('parameter','c_id','c_id');
  10. }
  11. public function buycar () {
  12. return $this->belongsTo('BuycarModel','c_id','c_id');
  13. }
  14. public function getCImagesAttr($c_images)
  15. {
  16. return $c_images = explode(',',$c_images);
  17. }
  18. }