1234567891011121314151617181920 |
- <?php
- namespace app\api\model;
- use think\Model;
- class CommodityModel extends Model
- {
- protected $name = "commodity";
- protected $resultSetType = 'collection';
- public function parameter () {
- return $this->hasMany('parameter','c_id','c_id');
- }
- public function buycar () {
- return $this->belongsTo('BuycarModel','c_id','c_id');
- }
- public function getCImagesAttr($c_images)
- {
- return $c_images = explode(',',$c_images);
- }
- }
|