ProductsModel.php 497 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace app\common\model;
  3. use think\Model;
  4. class ProductsModel extends Model
  5. {
  6. protected $name = "products";
  7. const STOP = 0;
  8. const NORMAL = 1;
  9. //状态
  10. public $status_list = [
  11. '-1' => '全部',
  12. self::STOP => '停用',
  13. self::NORMAL => '正常'
  14. ];
  15. //产品
  16. public function productsList()
  17. {
  18. return $this->hasMany('ProductLists', 'type_id', 'id');
  19. }
  20. }