select($select) ->limit(100) ->asArray(true) ->all(); return $list; } /** * @inheritdoc */ public function rules() { return [ [['id'], 'number'], [['name'], 'string', 'max' => 255], ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => 'Order ID', 'name' => 'Spider Order ID', ]; } /** * Function Description:插入主订单 * Function Name: insertOrder * * @return bool * * @author 娄梦宁 */ public function insertOrder(){ $values=[ 'name'=>'3333', ]; $transaction=Yii::$app->db->beginTransaction(); try{ $this->attributes=$values; $res=$this->insert(true); if(!$res){ throw new Exception('添加出错'); } $transaction->commit(); return true; }catch (Exception $e){ $transaction->rollBack(); return false; } } }