Brand.php 926 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace app\backend\modules\goods\models;
  3. /**
  4. * Created by PhpStorm.
  5. * Author: 芸众商城 www.yunzshop.com
  6. * Date: 2017/2/27
  7. * Time: 上午9:18
  8. */
  9. class Brand extends \app\common\models\Brand
  10. {
  11. static protected $needLog = true;
  12. /**
  13. * @param $id
  14. * @return mixed
  15. */
  16. public static function deletedBrand($id)
  17. {
  18. return self::where('id', $id)
  19. ->delete();
  20. }
  21. // public function keywordGetBrand($keyword)
  22. // {
  23. // return self::uniacid()->where('name','like', '%'.$keyword .'%')->select(['id','name']);
  24. // }
  25. /**
  26. * 定义字段名
  27. * 可使
  28. * @return array */
  29. public function atributeNames() {
  30. return [
  31. 'name'=> '品牌名称',
  32. ];
  33. }
  34. /**
  35. * 字段规则
  36. * @return array */
  37. public function rules() {
  38. return [
  39. 'name' => 'required',
  40. ];
  41. }
  42. }