1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- <?php
- namespace common\models;
- class CategoryTel extends Common
- {
- public function rules()
- {
- return [
- [['tel','name'],'required','message'=>'{attribute}不能为空'],
- ['del','in','range'=>[1,2]],
- ['city','number'],
- ];
- }
- public function attributeLabels()
- {
- return [
- 'tel'=>'电话集合',
- 'name'=>'方案名称',
- ];
- }
- public function getList($input='')
- {
- $query = self::find();
- $query->andWhere(['del'=>$this->setDel]);
- if(!empty($input['city'])){
- if(is_numeric($input['city'])){
- $query->andWhere(['city'=>$input['city']]);
- }
- if(is_string($input['city'])){
- $city = explode(',',$input['city']);
- $query->andWhere(['city'=>$city]);
- }
- }
- $query->orderBy(['create_at'=>SORT_DESC]);
- $query->asArray();
- return $query->all();
- }
- public function CitySchemeTouch()
- {
- $query = CategoryCity::find();
- }
-
- public function Authenticator($input)
- {
- $this->load($input,'');
- if(!$this->validate()) return $this->errors;
- return $this;
- }
- public function FindById($id)
- {
- return self::findOne($id);
- }
- }
|