|
- <?php
-
- namespace backend\modules\api\models;
-
- use Yii;
-
- /**
- * This is the model class for table "base_bus_cost".
- *
- * @property integer $id
- * @property integer $supplier_id
- * @property integer $bus_res_id
- * @property string $base_cost
- * @property string $comment
- */
- class BaseBusCost extends \yii\db\ActiveRecord
- {
- /**
- * @inheritdoc
- */
- public static function tableName()
- {
- return 'base_bus_cost';
- }
-
- /**
- * @inheritdoc
- */
- public function rules()
- {
- return [
- [['supplier_id', 'bus_res_id'], 'integer'],
- [['base_cost'], 'number'],
- [['comment'], 'string', 'max' => 100],
- ];
- }
-
- /**
- * @inheritdoc
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'supplier_id' => 'Supplier ID',
- 'bus_res_id' => 'Bus Res ID',
- 'base_cost' => 'Base Cost',
- 'comment' => 'Comment',
- ];
- }
-
- /**
- * Function Description:获取供应商基本价格信息
- * Function Name: getBaseCost
- *
- * @return array|\yii\db\ActiveRecord[]
- *
- * @author 李健
- */
- public function getBaseCost()
- {
- $select = [
- 'supplier_id',
- 'bus_res_id',
- 'base_cost'
- ];
- $res = self::find()
- ->select($select)
- ->from(self::tableName())
- ->where('id>0')
- ->asArray()
- ->all();
- return $res;
- }
- }
|